]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-reset.txt
Documentation/git-http-fetch.txt: Document the commit-id argument.
[thirdparty/git.git] / Documentation / git-reset.txt
CommitLineData
215a7ad1
JH
1git-reset(1)
2============
7fc9d69f
JH
3
4NAME
5----
215a7ad1 6git-reset - Reset current HEAD to the specified state.
7fc9d69f
JH
7
8SYNOPSIS
9--------
215a7ad1 10'git-reset' [--mixed | --soft | --hard] [<commit-ish>]
7fc9d69f
JH
11
12DESCRIPTION
13-----------
f67545ea
LAS
14Sets the current head to the specified commit and optionally resets the
15index and working tree to match.
7fc9d69f 16
936a2342
AE
17This command is useful if you notice some small error in a recent
18commit (or set of commits) and want to redo that part without showing
19the undo in the history.
20
21If you want to undo a commit other than the latest on a branch,
22gitlink:git-revert[1] is your friend.
23
7fc9d69f
JH
24OPTIONS
25-------
f67545ea 26--mixed::
936a2342
AE
27 Resets the index but not the working tree (ie, the changed files
28 are preserved but not marked for commit) and reports what has not
29 been updated. This is the default action.
f67545ea
LAS
30
31--soft::
32 Does not touch the index file nor the working tree at all, but
936a2342
AE
33 requires them to be in a good order. This leaves all your changed
34 files "Updated but not checked in", as gitlink:git-status[1] would
35 put it.
7fc9d69f 36
f67545ea
LAS
37--hard::
38 Matches the working tree and index to that of the tree being
936a2342
AE
39 switched to. Any changes to tracked files in the working tree
40 since <commit-ish> are lost.
7fc9d69f 41
f67545ea
LAS
42<commit-ish>::
43 Commit to make the current HEAD.
7fc9d69f
JH
44
45Author
46------
47Written by Junio C Hamano <junkio@cox.net> and Linus Torvalds <torvalds@osdl.org>
48
49Documentation
50--------------
51Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
52
53GIT
54---
a7154e91 55Part of the gitlink:git[7] suite
7fc9d69f 56