git revert
command
Creates a new commit that undoes changes from a specified commit. Safe for shared/public branches.
Syntax
git revert <commit>
Example
bash
# Revert the last commit
git revert HEAD
# Revert a specific commit
git revert abc1234
# Revert without creating commit (stage changes only)
git revert --no-commit abc1234