Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 862 Bytes

Git_RecoverLost.md

File metadata and controls

31 lines (25 loc) · 862 Bytes
title date
Recover Lost Stashes or Commits
2023-07-25

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>