← Quiz: Undoing Changes: all 10 questions
Quiz: Undoing Changes · Question 2 of 10
Which reset keeps your changes staged?
Which reset keeps your changes staged?
- A.git reset --soft HEAD~1
- B.git reset --hard HEAD~1
- C.git reset --mixed HEAD~1
- D.git restore
Answer & explanation
Correct answer: git reset --soft HEAD~1
--soft moves the branch back but keeps everything staged.
Can you get the rest right without peeking?
Take the timed Quiz: Undoing Changes quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →