Skip to content

Instantly share code, notes, and snippets.

@emjayess
Created September 28, 2012 19:48
Show Gist options
  • Save emjayess/3801772 to your computer and use it in GitHub Desktop.
Save emjayess/3801772 to your computer and use it in GitHub Desktop.
Recovering stashes that were cleared/dropped erroneously

Recovering stashes that were cleared/dropped erroneously

If you mistakenly drop or clear stashes, they cannot be recovered through the normal safety mechanisms. However, you can try the following incantation to get a list of stashes that are still in your repository, but not reachable any more:

git fsck --unreachable | grep commit | cut -d\  -f3 | xargs git log --merges --no-walk --grep=WIP
@emjayess
Copy link
Author

via
$ git help stash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment