What is the difference between git reset and git revert?
| git reset | git revert |
|---|---|
| Moves the branch pointer back, removing commits from the history | Creates a new commit which cancels the old commit |
| Rewrites history | History is kept |
| Use for local commits not pushed yet | Use for commits already pushed and shared |
| Has modes: soft, mixed, hard | Can 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. |