🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.git reset --soft HEAD~1
  2. B.git reset --hard HEAD~1
  3. C.git reset --mixed HEAD~1
  4. 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 →