title | date |
---|---|
Recover Lost Stashes or Commits |
2023-07-25 |
Table of Contents
- Find them from unreachable commit and filter it.
git fsck --unreachable | grep commit | cut -d ' ' -f3 | xargs git log --merges --no-walk
- Put the stash back where it comes from.
or Apply the stash to working copy.
git update-ref refs/stash <hash> -m --create-reflog "poor little stash"
git stash apply <hash>