Git Revert Purpose
Question
How does git revert differ from git reset?
Hint
revert is safe for shared history; reset is not.
Explanation
git revert <commit> creates a new commit that undoes the changes of the specified commit. This preserves history — the original commit remains, and a new "undo" commit is added. This is safe for pushed/shared commits. git reset moves the branch pointer, effectively removing commits from history. reset is for local cleanup; revert is for shared history. Use revert when you need to undo a change that others may already have.
Related Resources
Related Lessons
- Git Reset
Learn git reset.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.