← Quiz: Rebase vs Merge and Clean History: all 15 questions
Quiz: Rebase vs Merge and Clean History · Question 14 of 15
A branch was already pushed and a teammate may have pulled it. You want to undo one of its commits. What should you use?
A branch was already pushed and a teammate may have pulled it. You want to undo one of its commits. What should you use?
- A.git rebase -i and drop the commit
- B.git reset --hard and force push
- C.git revert, which adds a new undoing commit
- D.git commit --amend
Answer & explanation
Correct answer: git revert, which adds a new undoing commit
Never rewrite history that others may have; revert is safe.
Can you get the rest right without peeking?
Take the timed Quiz: Rebase vs Merge and Clean History quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →