Promptles
Git & Collaboration

Reset vs Revert

advanced

Definition

Two ways to undo a change. Reset rewinds the project's history as if the change never happened: fine in private, but disruptive on a shared branch where teammates have already seen it. Revert leaves the original change in the history and adds a brand-new change on top that cancels it out: safer for shared work.

In the wild

A developer pushes a buggy change to the shared main version of the project. Instead of trying to rewind history (which would confuse everyone who already pulled it), she reverts: adding a new change that undoes the buggy one. The history honestly shows: 'we made a mistake, then we undid it.'

More from Git & Collaboration