Skip to main content
PProfileMatch
← Path

Git and GitHub · Undo Changes in Git: Restore, Revert, Reset and Reflog Explained

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Bike repair clinic: past the point of return

Trick to keep in mind+3 XP

Shared history? Revert adds a correction; it never rewrites.

Once teammates have a commit, rewriting it makes their history disagree with yours. git revert creates a new commit that applies the opposite change, so history only ever grows and everyone stays in step. Reset and amend are for work that has not left your own machine.

Read it once, then a question tests whether the trick stuck.