Git Cheatsheet - Quick Git Command Reference

Quick reference for common Git commands. Search, copy, and use Git commands instantly.

Share
Back to Git Cheatsheet

git revert

Create new commit that reverts specified commit

Syntax

git revert [options] <commit>

Common Options

OptionDescription
-n, --no-commitDo not auto-commit
-m <parent>Specify mainline for merge revert
--continueContinue after resolving conflicts
--abortAbort revert operation

Examples

git revert HEAD

Revert last commit

git revert a1b2c3d

Revert specific commit

git revert -m 1 HEAD

Revert merge commit

git revert --no-commit HEAD~3..HEAD

Revert last 3 commits without auto-commit

Related Tools

More Code & Dev Tools