codepanuvom Course

Lesson 12 · Undo: reset, reflog, revert

Undo: reset, reflog, revert

reset moves your branch back: --soft keeps changes staged, --hard throws them away. reflog remembers where HEAD has been, so even a --hard reset can be undone. revert adds a new commit that cancels an old one: the only safe undo for commits already pushed.