]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-revert.txt
Documentation: be consistent about "git-" versus "git "
[thirdparty/git.git] / Documentation / git-revert.txt
CommitLineData
215a7ad1
JH
1git-revert(1)
2=============
7fc9d69f
JH
3
4NAME
5----
7bd7f280 6git-revert - Revert an existing commit
7fc9d69f
JH
7
8SYNOPSIS
9--------
b1889c36 10'git revert' [--edit | --no-edit] [-n] [-m parent-number] [-s] <commit>
7fc9d69f
JH
11
12DESCRIPTION
13-----------
52a22d1e
LAS
14Given one existing commit, revert the change the patch introduces, and record a
15new commit that records it. This requires your working tree to be clean (no
16modifications from the HEAD commit).
7fc9d69f
JH
17
18OPTIONS
19-------
52a22d1e
LAS
20<commit>::
21 Commit to revert.
41a5564e 22 For a more complete list of ways to spell commit names, see
5162e697 23 "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
7fc9d69f 24
3240240f
SB
25-e::
26--edit::
8bf14d6e 27 With this option, `git-revert` will let you edit the commit
233808db 28 message prior to committing the revert. This is the default if
8bf14d6e
PB
29 you run the command from a terminal.
30
3240240f
SB
31-m parent-number::
32--mainline parent-number::
7791ecbc
JH
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.
38
8bf14d6e
PB
39--no-edit::
40 With this option, `git-revert` will not start the commit
41 message editor.
42
3240240f
SB
43-n::
44--no-commit::
de2b82c6
JH
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
52 working tree.
df8baa42
JF
53+
54This is useful when reverting more than one commits'
55effect to your working tree in a row.
de2b82c6 56
3240240f
SB
57-s::
58--signoff::
cfd9c277
DM
59 Add Signed-off-by line at the end of the commit message.
60
de2b82c6 61
7fc9d69f
JH
62Author
63------
64Written by Junio C Hamano <junkio@cox.net>
65
66Documentation
67--------------
68Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
69
70GIT
71---
9e1f0a85 72Part of the linkgit:git[1] suite