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

How is git revert different from git reset?

How is git revert different from git reset?

  1. A.revert adds a new commit that undoes changes; reset moves the branch and rewrites history
  2. B.revert deletes commits from GitHub
  3. C.They are identical
  4. D.reset only works on pushed commits
Answer & explanation

Correct answer: revert adds a new commit that undoes changes; reset moves the branch and rewrites history

That is why revert is the safe choice for commits others already have.

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 →