I frequently use git stash and git stash pop to save and restore changes in my working tree. Yesterday I had some changes in my working tree that I
If you didn't close the terminal, just look at the output from git stash pop and you'll have the object ID of the dropped stash. It normally looks like this:
$ git stash pop
[...]
Dropped refs/stash@{0} (2ca03e22256be97f9e40f08e6d6773c7d41dbfd1)
(Note that git stash drop also produces the same line.)
To get that stash back, just run git branch tmp 2cae03e, and you'll get it as a branch. To convert this to a stash, run:
git stash apply tmp
git stash
Having it as a branch also allows you to manipulate it freely; for example, to cherry-pick it or merge it.