Skip to content

Instantly share code, notes, and snippets.

@sevenseacat
Created June 4, 2014 07:48
Show Gist options
  • Save sevenseacat/b42256f87070c3f6044b to your computer and use it in GitHub Desktop.
Save sevenseacat/b42256f87070c3f6044b to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment