A Plain, Real Interruption
git stash push -m "wip: description"
# ...handle the urgent thing...
git stash pop
Real, uncommitted work set aside with a genuine, searchable message, restored the moment it is safe to return to it.
Two Real Stashes, the Older One Needed
git stash list
git stash apply stash@{1}
apply (unlike pop) leaves the stash entry in the list afterward — useful when the SAME real stashed change might be needed again, or when a newer stash still needs handling separately.
Only the Real Staged Part
git stash push --staged -m "wip: staged part only"
Stashes exactly what is staged, leaving any other real, unstaged edits in the working directory completely untouched.
git stash sets aside real, uncommitted work — without committing it — so the working directory is genuinely clean for something else. This lab runs through three real scenarios where that matters in different ways: a plain interruption (stash, handle it, come back), juggling two real stashes at once (and needing the older one specifically, not just the most recent), and stashing only what is actually staged, leaving other real, unstaged work exactly where it was.
git stash apply vs. git stash pop
Both restore a real stashed change — pop also removes it from the stash list afterward, apply leaves it there. Confirmed directly in this lab: applying an older stash by index left it available for cleanup separately from the newer one.
git stash push --staged
Stashes only what is currently staged, leaving unstaged real changes in the working directory exactly as they were. Confirmed directly in this lab: a second file's real, unstaged edit survived completely untouched.
Takeaways
- git stash push -m sets aside real, uncommitted work with a genuine, searchable message
- git stash apply stash@{n} restores a specific stash by index without removing it from the list — unlike pop
- git stash push --staged stashes only what is currently staged, leaving other real edits untouched
- Stashes are local-only and never appear in git log — the wrong tool for anything meant to be shared