Predict Revert Result
Predict Output Medium
Question
You run `git revert HEAD`. What does Git do?
Code
git revert HEAD
Hint
Revert creates a new commit, it does not delete the original.
Explanation
git revert HEAD creates a new commit that reverses the changes introduced by the current HEAD commit. The original commit remains in history. Git opens your editor for a commit message (default: 'Revert <original message>'), then creates the revert commit.
Related Resources
Related Lessons
Related Cheatsheets
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.