← Quiz: Undoing Changes: all 10 questions
Quiz: Undoing Changes · Question 4 of 10
How do you unstage a file but keep its changes?
How do you unstage a file but keep its changes?
- A.git restore --staged file
- B.git restore file
- C.git rm file
- D.git reset --hard
Answer & explanation
Correct answer: git restore --staged file
git restore file (without --staged) would discard the changes.
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 →