Cherry-pick and revert commits safely on shared branches

8 steps · about 1 h 32 min · Intermediate

  1. 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.

  2. Git Cherry Pick (tutorial, Atlassian, 12 min)

    Shows when cherry-picking a single commit makes sense (hotfixes, backports) and when merging is better.

  3. Git Revert (tutorial, Atlassian, 12 min)

    Explains why revert creates a new inverse commit instead of erasing history on shared branches.

  4. 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.

  5. 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.

  6. Git Documentation: git-format-patch (reference, Git, 12 min)

    Shows how to export commits as portable patch files when cherry-picking across disconnected repositories.

  7. GitHub Docs: About commits (doc, GitHub Docs, 8 min)

    Reviews commit metadata and authorship so cherry-picked commits keep clear provenance.

  8. 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.