📦 CHAPTER · GIT STASH
Chef You

The Emergency
Fridge

You're halfway through adding toppings when — emergency! You must switch branches. But you can't commit half-baked nonsense. git stash hides your work in a temporary fridge.

Scene I

Halfway through the toppings

Chef You

You're decorating a cake. Strawberries half-placed, chocolate drizzle mid-pour, whipped cream everywhere.

It looks messy. Incomplete. Not ready for anyone to see.

You'll stash your work twice — once for toppings, once for garnish — and learn the difference between pop and apply.

🚨
EMERGENCY INTERRUPTION
The head chef needs you to urgently fix the soup. You must switch branches!

Your toppings are half-done — you can't commit this mess.
📦 STASH #1: TOPPINGS Click each topping to stash it
🏠 WORKING DIRECTORY
git stash
❄️ STASH (fridge)
Task: Click each topping to stash it before switching!
Emergency Fix

🍲 Fix the soup recipe

With toppings safely stashed, you fix the soup. Crisis averted! 🎉

But wait — your colleague also needs you to stash some garnish work before reviewing their code.

📦 STASH #2: GARNISH Click each garnish to stash it
🏠 WORKING DIRECTORY
git stash
❄️ STASH (fridge)
Task: Stash the garnish items too!
📋 STASH LIST You have 2 stashes — choose what to do!
stash@{0} WIP on main: garnish items 🌿🍋🫒
stash@{1} WIP on main: cake toppings 🍓🍫🍦🫐🥜🍯
Select a stash entry, then choose POP or APPLY
Done!

🎉 Stash mastered!

You learned to stash multiple times, browse the stash list, and choose between pop and apply.

🔄
STASH POP
Restores work and deletes the stash entry. Use when done.
📋
STASH APPLY
Restores work but keeps the entry. Reusable across branches.
🗑️
STASH DROP
Deletes a stash without applying it. Clean up old entries.
Epilogue
Stash is temporary
invisibility.
Not history.

It's a fridge — not a pantry. You can stack multiple stashes, browse them with git stash list, and pick exactly which one to restore.

$ git stash list
stash@{0}: WIP on main: garnish
stash@{1}: WIP on main: toppings
$ git stash pop stash@{1}← specific entry
$ git stash apply stash@{0}← keep entry
$ git stash drop stash@{0}← cleanup