Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed Oct 13, 2014
1 parent ea4fa23 commit e65216b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/07-git-tools/sections/advanced-merging.asc
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ The downside of this approach is that it's rewriting history, which can be probl
Check out <<_rebase_peril>> for more on what can happen; the short version is that if other people have the commits you're rewriting, you should probably avoid `reset`.
This approach also won't work if any other commits have been created since the merge; moving the refs would effectively lose those changes.

[[_reverse_commit]]
===== Reverse the commit

If moving the branch pointers around isn't going to work for you, Git gives you the option of making a new commit which undoes all the changes from an existing one.
Expand Down
3 changes: 3 additions & 0 deletions book/C-git-commands/1-git-commands.asc
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ We also use it in an interactive scripting mode with the `-i` option in <<_chang

==== revert

The `git revert` command is essentially a reverse `git cherry-pick`. It creates a new commit that applies the exact opposite of the change introduced in the commit you're targeting, essentially undoing or reverting it.

We use this in <<_reverse_commit>> to undo a merge commit.

=== Email

Expand Down

0 comments on commit e65216b

Please sign in to comment.