Complete the command to undo the last commit but keep changes staged.
git reset --[1] HEAD~1
The --soft option moves the HEAD back but keeps your changes staged, allowing you to edit the commit.
Complete the command to discard all local changes in the working directory.
git checkout -- [1]Using . after git checkout -- discards all local changes in the current directory.
Fix the error in the command to undo the last commit completely, including changes.
git reset --[1] HEAD~1
The --hard option resets the commit and discards all changes in the working directory.
Fill both blanks to create a command that unstages files but keeps changes in the working directory.
git reset [1] [2]
git reset --mixed HEAD unstages files but keeps changes in your working directory.
Fill all three blanks to create a command that reverts a commit by creating a new commit.
git [1] [2] -m [3]
git revert commit_hash -m 1 creates a new commit that undoes changes from a merge commit.