Skip to the content.

Table of Contents

Recover Lost Stashes or Commits

Just Do It

  1. Find them from unreachable commit and filter it.
     git fsck --unreachable | grep commit | cut -d ' ' -f3 | xargs git log --merges --no-walk
    
  2. Put the stash back where it comes from.
     git update-ref refs/stash <hash> -m --create-reflog "poor little stash"
    

    or Apply the stash to working copy.

     git stash apply <hash>