Git · Junior · Question 51 of 75
What does git reset --soft HEAD~1 do?
- 1Creates a commit that undoes the last one
- 2Undoes the last commit and deletes its changes
- ✓Correct answer: Undoes the last commit but keeps its changes staged
Explanation
The branch moves back one commit while the index and files stay as they were. It's a quick way to redo a commit, for example to split it.