🎙 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 6 of 10

Which command throws away unstaged edits in a file?

Which command throws away unstaged edits in a file?

  1. A.git restore file
  2. B.git restore --staged file
  3. C.git revert file
  4. D.git stash pop
Answer & explanation

Correct answer: git restore file

This cannot be undone, so be sure you want to lose those edits.

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 →