6 git-revert - Revert an existing commit
10 'git revert' [--edit | --no-edit] [-n] [-m parent-number] [-s] <commit>
14 Given one existing commit, revert the change the patch introduces, and record a
15 new commit that records it. This requires your working tree to be clean (no
16 modifications from the HEAD commit).
22 For a more complete list of ways to spell commit names, see
23 "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
27 With this option, 'git-revert' will let you edit the commit
28 message prior to committing the revert. This is the default if
29 you run the command from a terminal.
32 --mainline parent-number::
33 Usually you cannot revert a merge because you do not know which
34 side of the merge should be considered the mainline. This
35 option specifies the parent number (starting from 1) of
36 the mainline and allows revert to reverse the change
37 relative to the specified parent.
40 With this option, 'git-revert' will not start the commit
45 Usually the command automatically creates a commit with
46 a commit log message stating which commit was reverted.
47 This flag applies the change necessary to revert the
48 named commit to your working tree, but does not make the
49 commit. In addition, when this option is used, your
50 working tree does not have to match the HEAD commit.
51 The revert is done against the beginning state of your
54 This is useful when reverting more than one commits'
55 effect to your working tree in a row.
59 Add Signed-off-by line at the end of the commit message.
64 Written by Junio C Hamano <junkio@cox.net>
68 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
72 Part of the linkgit:git[1] suite