Git · Junior · Question 30 of 75
What does git revert <commit> do?
- ✓Correct answer: Creates a new commit that undoes that commit's changes
- 2Moves the branch back to just before that commit
- 3Deletes the commit from the history completely
Explanation
History stays intact and the fix is just another commit, so revert is safe on shared branches such as main. Reset, by contrast, moves the branch and rewrites history.