← 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?
- A.git restore file
- B.git restore --staged file
- C.git revert file
- 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 →