Gitflow
🪂Recover a Dropped StashHard+700 XP
Scenario reference

Recover a Dropped Stash: the situation, step by step

The situation

You ran `git stash drop` thinking it was an old one. It was today's WIP. Stashes don't show in reflog, but the objects still exist.

`git fsck --unreachable` lists dangling commits — a dropped stash is one of them. Inspect before you apply.

Hard · 3 steps · +700 XP

What you will practice

This scenario walks through 3 steps, in order:

  1. 01List dangling objects
  2. 02Inspect the recovered entry before trusting it
  3. 03Re-apply it without consuming the entry
Reveal the step-by-step commands

Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.

  1. 1. List dangling objects
    git fsck --unreachable --no-reflogs
  2. 2. Inspect the recovered entry before trusting it
    git stash show -p stash@{0}
  3. 3. Re-apply it without consuming the entry
    git stash apply stash@{0}

Key takeaway

A dropped stash lives on as a dangling commit until `git gc` prunes it: fsck finds it, `stash show -p` proves it is the right one, `stash apply` puts it back without consuming it.