Undo a Commit, Keep the Work
Reset moves your branch pointer backwards. What happens to the work in the commits you moved past depends on which mode you use.
--soft is the gentlest: the commit is undone, but everything it contained lands back in your staging area, ready to commit again.
Think of it as amend's bigger sibling. Amend revises the last commit in place; reset --soft steps back as many commits as you like and hands you all of their work, staged, to recommit however you want.
Exercises
- Exercise 1. Move main back to c0 so the commit is undone — but keep its changes staged. Watch the Staged row.
- Exercise 2. Reset can skip back further than one commit. Undo both commits at once, keeping all of their work staged together.