📖 Concepts
RevertCreates a NEW commit that undoes the changes from a previous commit. Safe for shared history — it doesn't rewrite the past.
Reset (--soft)Moves the branch pointer backward but keeps changes in the staging area. The working directory stays untouched.
Reset (--mixed)Moves the branch pointer and unstages changes. This is the default mode. Changes remain in your working directory.
Reset (--hard)Moves the branch pointer, unstages changes, AND resets the working directory. Destructive — uncommitted changes are lost.
View the commit history
Notice the latest commit "Oops bad commit" is the last entry. We want to undo it.
● View the commit history
○ Revert the bad commit
○ Reset to remove the last 2 commits (soft)
○ Reset mixed (default)
○ Reset hard — discard everything