Predict Reset --soft Result
Predict Output Medium
Question
You run `git reset --soft HEAD~1`. What is the state of your files and staging area?
Code
git reset --soft HEAD~1
Hint
--soft keeps changes in the staging area.
Explanation
git reset --soft HEAD~1 moves the branch pointer back one commit, but leaves the staging area and working directory untouched. The changes from the undone commit appear as staged changes, ready to re-commit. This is useful for amending the last commit's message.
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.