Cherry-pick and revert commits safely on shared branches
8 steps · about 1 h 32 min · Intermediate
- Commits are snapshots, not diffs (article, GitHub Blog, 10 min)
Builds the mental model of how Git stores snapshots and computes diffs on demand for cherry-pick and revert.
- Git Cherry Pick (tutorial, Atlassian, 12 min)
Shows when cherry-picking a single commit makes sense (hotfixes, backports) and when merging is better.
- Git Revert (tutorial, Atlassian, 12 min)
Explains why revert creates a new inverse commit instead of erasing history on shared branches.
- GitHub Docs: Reverting a pull request (doc, GitHub Docs, 8 min)
Covers reverting merged pull requests cleanly and the gotcha of re-merging the same branch later.
- Pro Git: Maintaining a Project (guide, Pro Git, 20 min)
Discusses maintainer workflows for applying patches, cherry-picking fixes onto release branches, and preserving attribution.
- Git Documentation: git-format-patch (reference, Git, 12 min)
Shows how to export commits as portable patch files when cherry-picking across disconnected repositories.
- GitHub Docs: About commits (doc, GitHub Docs, 8 min)
Reviews commit metadata and authorship so cherry-picked commits keep clear provenance.
- GitHub Docs: About pull requests (doc, GitHub Docs, 10 min)
Connects cherry-pick and revert commits back into team review before landing on release branches.