Revert Commit Fill
Fill in the Blank Medium
Question
Fill in the blank to undo the last commit by creating a revert commit.
Code
git revert ___
Hint
HEAD refers to the current commit.
Explanation
git revert HEAD creates a new commit that undoes the changes of the current HEAD commit. HEAD is a pointer to the currently checked-out commit. You can also use HEAD~1 for the second-to-last commit, or a specific commit hash.
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.