🔀Git Revert
Also known as git revert, Revert a Commit, Revert Commit
A new commit that undoes an old one. The old one stays in the history.
Think of it like
Think of it like a new diary line that says to forget what you wrote yesterday. The old page stays.
Example
A bad change broke the order page on main. Jack reverts that commit, pushes, and the site works again.
Why it matters
It is the safe way to undo on a shared branch. Nobody's copy of the history breaks.
Definition
Example code
console
$ git revert 7b8c9d0
[main 5e6f7a8] Revert "Fix the price on the order page"
1 file changed, 1 insertion(+), 2 deletions(-)