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

  1. A.git rebase -i and drop the commit
  2. B.git reset --hard and force push
  3. C.git revert, which adds a new undoing commit
  4. 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 →