adit adit - 1 year ago 169
Git Question

Undo a git stash

I just did a stash in a project that I haven't commit. Is there a way to go back to the state before I stashed? How could I do this? I've closed the terminal and my laptop is shut down. I've done some researched and it seems there's no way to do this.

Answer Source

You can just run:

git stash pop

and it will unstash your changes.

If you want to preserve the state of files (staged vs. working), use

git stash apply --index
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download