Git · History and recovery
git revert
Creates a new commit that undoes an earlier one. It is safe on shared history.
Syntax
git revert <commit>Example
Example
git revert 1a2b3c4
More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.