← 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?
- A.git reset --hard
- B.git revert <commit>
- C.git commit --amend
- 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 →