1

I popped a stash which led to some unintended consequences. Fortunately the stash contents weren't very important. The last commit SHA (pre-pop) was b1a6d2919dc8a8e80122466cf8662196102ba2d4

Is there some way to easily reverse this pop using this SHA?

Abram
  • 39,950
  • 26
  • 134
  • 184

1 Answers1

0

if you want to discard the STASH entirely. try git reset --hard <SHA>

Zac Wrangler
  • 1,445
  • 9
  • 8
  • I wonder if this will work as I currently show "nothing to commit, working directory clean" ... post POP – Abram Oct 07 '13 at 22:28
  • this is not a commit it will reset your current HEAD to the commit . http://stackoverflow.com/questions/2530060/can-you-explain-what-git-reset-does-in-plain-english – Zac Wrangler Oct 07 '13 at 22:33
  • I thought when you popped a stash it applied the stash as uncommited changes? Or is that handled differently? This is my confusion.. – Abram Oct 07 '13 at 22:35
  • you are right, popped stash will be applied as uncommitted changes. – Zac Wrangler Oct 07 '13 at 22:41
  • Hmm.. So why do I see nothing to commit message.. while at the same time having changes made to my repo? I tried looking in gitg for the modifications, but cannot see anything but my last real commit. I am so confused. – Abram Oct 07 '13 at 22:55
  • my guess, either the stash is overlapping with one of your previous commit, or you have configured git to ignore changes from it. – Zac Wrangler Oct 07 '13 at 23:01
  • Hmm, well, I have just re-cloned my repository. Fortunately that seems to have fixed the issues. Interestingly the stash is gone completely, so I guess this wasn't saved to my remote repo. – Abram Oct 07 '13 at 23:07