From e58b976218dba56b2eaa767d09d4ddb41186d0f8 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 30 Jun 2015 00:59:42 +0300 Subject: [PATCH] Explain git revert --- pep-git.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pep-git.txt b/pep-git.txt index b2e3038..d42184b 100644 --- a/pep-git.txt +++ b/pep-git.txt @@ -482,8 +482,16 @@ do something like:: git revert: revert a commit --------------------------- -How to undo a merge -https://www.kernel.org/pub/software/scm/git/docs/howto/revert-a-faulty-merge.html +``git revert`` reverts a commit or commits, that is, it creates a new +commit or commits that reverts the effects of the given commits. It's +the only way to undo published commits (``git commit --amend``, ``git +rebase`` and ``git reset`` change the branch in non-fast-forwardable +ways so they should only be used for non-pushed commits.) + +There is a problem with reverting a merge commit. ``git revert`` can +undo the code created by the merge commit but it cannot undo the fact +of merge. See the discussion `How to revert a faulty merge +`_. One thing that cannot be undone ------------------------------- -- 2.39.5