Subject: Re: Newbie question: Is it possible to undo a stash?

From: Jean-Luc Herren <[email-masked]>
Date: Wed, 14 May 2008 22:51:40 +0200

Hello!

Iván V. wrote:
> I just did a git stash, and then changed my mind and ran git apply,
> thinking that would get me back to where I was...

Certainly you mean "git stash apply".  "git apply" is something
different.

> Now I have lots of conflicting merges and files that came back from
> the dead (and some files seem lost)... I've been trying to go step by
> step to try to get the tree to where it was, but it's very
> complicated, so I was wondering if there is anything I can do to get
> my working tree exactly to where it was before I ran git stash...

git stash pop --index

I think that should get you exactly where you were before "git
stash".  The --index makes it also restore the index, which
wouldn't happen by default.  Using 'pop' instead of 'apply' makes
it remove the stash after re-applying it.

jlh