Git, rewrite the history
summary
A live Git surgery demo showing how to rewrite history using git commit --amend, git reflog and git reset to roll back commits, creating a branch with git switch -c, and performing an interactive rebase (git rebase -i) with --autosquash plus fixup/squash. The demo includes an Exec step that runs tests (which can stop the rebase on failure so fixes are made), recovers lost commits from the reflog across about 18 commits, and demonstrates safe sharing with git push --force-with-lease and using git revert for public history.
AI-written summary · about
chapters (13)
- 0:00Git history rewrite intro
- 3:33Git walkthrough prep
- 5:22Fix commit with amend
- 7:11Navigate with reflog
- 8:15Go back with reset
- 9:23New branch with switch
- 10:51Rebase a branch
- 15:28Interactive rebase
- 26:57Risks and best practices
- 31:11Clean history benefits
- 35:04Git for Open Source teams
- 36:50Tips and useful tools
- 39:44Conclusion








