git-revert
Create new commits which reverse the effect of earlier ones. tldr-pages
On several platforms
Several platforms
Revert the most recent commit
git revert HEADIdentifyRevert the 5th last commit
git revert HEAD~4IdentifyRevert a specific commit
git revert 0c01a9IdentifyRevert multiple commits
git revert branch_name~5..branch_name~2IdentifyDon't create new commits, just change the working tree
git revert --no-commit 0c01a9..9a1743IdentifyCancel a Git revert after a merge conflict
git revert --abortIdentify