What is the difference between git reset and git revert?

git resetgit revert
Moves the branch pointer back, removing commits from the historyCreates a new commit which cancels the old commit
Rewrites historyHistory is kept
Use for local commits not pushed yetUse for commits already pushed and shared
Has modes: soft, mixed, hardCan undo any older commit, even in the middle

See Git Reset and Git Revert.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.