⏪ CHAPTER 7 · GIT RESET
Chef You

Undo Recent
Decisions

You accidentally added salt instead of sugar. Reset lets you rewind — but how far back you go determines the damage.

Scene I

Salt instead of sugar 🧂

Chef You

You just committed a recipe change. But wait — you accidentally wrote "Add 3 spoons of salt" when you meant "Add 3 spoons of sugar".

The commit is done. It's in history. How do you undo this?

⏪ COMMIT TIMELINE Choose a reset level
Choose how far back to rewind:
🟢
--soft
Undo the commit, but keep changes staged. Safe to re-commit.
SAFE
🟠
--mixed
Undo commit AND unstage. Changes stay in working dir.
MODERATE
🔴
--hard
Undo everything. Changes are GONE. Time-travel with explosives.
⚠️ DANGER
Result

Scene II

The golden rule

History rewriting is powerful but dangerous in shared projects.

--soft is gentle.
--mixed is cautious.
--hard is a sledgehammer.

⚠️ WARNING
Never rewrite public history unless you enjoy chaos. If you've pushed commits that others are working on, reset can break everyone's timeline.
Epilogue
There are levels of reset.
Some are safe.
Some are time-travel
with explosives.
--soft
Undo commit only
--mixed
Undo commit + staging
--hard
Undo everything ☠️