Recovery

Recover a lost stash

When stash entries seem to disappear, determine whether they were popped, dropped, or detached from refs, then recover via reflog or dangling commits.

Who This Is For
  • Anyone actively handling a Git mistake
  • Readers who want a conservative rescue habit before trouble happens
Prerequisites
  • Stop mutating the repo further
  • Be ready to inspect `git reflog`, `git status`, and `git log --graph`
Common Risks
  • Running more reset or rebase commands before preserving a checkpoint
  • Changing shared history before assessing blast radius

A “missing stash” is often a missing reference, not immediate data destruction.

Identify the loss type first

  1. stash was popped and no longer listed
  2. stash was dropped or cleared
  3. stash commit still exists but ref moved
Recover Lost StashStash contents are not immediately deleted; the corresponding commit object may still be recoverable via reflog.
Stash history
HEAD@{3}HEAD@{2}HEAD@{1}Current
Recovery action
rescue/recover

First checks

git stash list
git reflog show stash
git reflog

If stash reflog exists, recover from there first.

If stash list is empty

Search dangling objects and inspect candidates:

git fsck --no-reflog | rg dangling
git show <commit>

When you find the target, preserve it immediately:

git switch -c rescue/stash-recovery <commit>

Recovery options

  • restore patch only: git show <commit> > rescue.patch
  • restore working changes: apply stash ref or cherry-pick from rescue branch
Create a rescue branch before applying anything

Repeated apply/pop attempts on your active branch can worsen state confusion. Preserve evidence first.

Good follow-up reads

  1. reflog recovery
  2. recover after reset
  3. git-stash