Recall & Review
beginner
What does
git reset --soft do?Moves the HEAD to a specified commit but keeps changes staged in the index and working directory unchanged.
Click to reveal answer
beginner
What is the effect of
git reset --mixed?Moves HEAD to a specified commit and unstages changes, but keeps them in the working directory.
Click to reveal answer
beginner
What happens when you run
git reset --hard?Moves HEAD to a specified commit and discards all changes in the index and working directory, resetting everything to that commit.
Click to reveal answer
beginner
Which
git reset option keeps your changes staged?--soft keeps changes staged after moving HEAD.Click to reveal answer
beginner
Which
git reset option discards all local changes?--hard discards all local changes in the working directory and index.Click to reveal answer
What does
git reset --soft HEAD~1 do?✗ Incorrect
--soft moves HEAD but keeps changes staged in the index.
Which reset option unstages changes but keeps them in the working directory?
✗ Incorrect
--mixed resets the index but not the working directory.
What is the risk of using
git reset --hard?✗ Incorrect
--hard discards all uncommitted changes, which cannot be recovered easily.
After
git reset --mixed, where are your changes?✗ Incorrect
Changes remain in the working directory but are unstaged.
Which command moves HEAD but leaves both index and working directory unchanged?
✗ Incorrect
--soft moves HEAD only, keeping index and working directory intact.
Explain the differences between
git reset --soft, --mixed, and --hard in your own words.Think about what happens to HEAD, index (staging), and working directory.
You got /3 concepts.
When would you use
git reset --hard and what should you be careful about?Consider the risk of losing work.
You got /3 concepts.