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

A bad commit is already pushed and teammates pulled it. What's the safe way to undo it?

A bad commit is already pushed and teammates pulled it. What's the safe way to undo it?

  1. A.git reset --hard
  2. B.git revert <commit>
  3. C.git commit --amend
  4. D.Delete the repository
Answer & explanation

Correct answer: git revert <commit>

revert adds a new commit that undoes the change without rewriting shared history.

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 →