● Chapter 4 · 0 of 9 done
Oops
Amend, reset, revert, reflog and leaked secrets.
Start chapter 4 →- Fix the commit you just madeAdd a forgotten file and repair a typo, without a second commit.
- Undo a commit, keep the workSplit one muddled commit into two clean ones.
- Throw an experiment awayRemove a commit, uncommitted edits and a stray file for good.
- Committed on the wrong branchMove a commit from main to a branch of its own.
- Undo something already sharedTake back a pushed commit without rewriting history.
- Get lost commits backA hard reset removed two commits. The reflog still knows them.
- Bring back a deleted branchThe branch name is gone, the commits are not.
- A secret in your last commitRemove a key from a commit before anyone sees it.
- A secret already on the serverReplace the key first, then stop tracking the file.