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
In OSX with git v2.6.4, I just run git stash drop accidentally, then I found it by going trough below steps
If you know name of the stash then use:
$ git fsck --unreachable | grep commit | cut -c 20- | xargs git show | grep -B 6 -A 2 <name of the stash>
otherwise you will find ID from the result by manually with:
$ git fsck --unreachable | grep commit | cut -c 20- | xargs git show
Then when you find the commit-id just hit the git stash apply {commit-id}
Hope this helps someone quickly