Skip to content
>devspeak
← glossary
level 3Git & Version Control

Revert

also: reverted, reverting, git revert

Undoing an earlier commit by adding a new commit that does the opposite, so the history stays intact.

a bit more technical

"git revert" creates a new commit that applies the inverse of a chosen commit's changes. History isn't rewritten, so it's safe on shared branches others have already pulled. Agents sometimes say "revert" loosely to mean discarding their uncommitted edits.

picture it

A bank correcting a wrong charge. They don't erase the original transaction. They add a refund. The statement shows both, and the balance is right.

why it matters

Revert is the safe undo for changes that are already committed and pushed. It removes the bad change without destroying anything or confusing collaborators.

what your agent might say
agent
I've reverted commit a1b2c3d ('Switch to new pricing API'). The revert is a new commit, so history is preserved and it's safe to push.
how you might use it
you → your agent
Revert the commit that changed the invoice layout, but keep everything that came after it. Don't rewrite history.
common mistake

Thinking revert deletes the commit. The original stays in history; revert adds a new commit on top that cancels it out.

builds on