Skip to content
Back to library
intermediateUndoing Changes

Revert

The Definition

Revert creates a new commit that undoes changes from a previous commit without removing it from history.

Mental Model

"Revert is like saying "Oops, let's undo that" in a meeting. You don't erase what was said; you add a new statement that says "ignore what I said earlier"."

Visual Simulation

Live Engine
ERROR COMMITRREVERT
Revert never deletes history. It adds a "fix" commit.

Watch Out (Common Pitfalls)

!

Confusing revert with reset

!

Reverting a revert commit (double revert)

!

Not understanding revert is safer for shared history

Hands-on Command

shell
~ $git revert a1b2c3d