A3.8 Appendix C: Git Commands - Patching

Patching

A few commands in Git are centered around the concept of thinking of commits in terms of the changes they introduce, as though the commit series is a series of patches.
These commands help you manage your branches in this manner.

git cherry-pick

The git cherry-pick command is used to take the change introduced in a single Git commit and try to re-introduce it as a new commit on the branch you’re currently on.
This can be useful to only take one or two commits from a branch individually rather than merging in the branch which takes all the changes.

git revert

The git revert command is essentially a reverse git cherry-pick.
It creates a new commit that applies the exact opposite of the change introduced in the commit you’re targeting, essentially undoing or reverting it.