]>
Commit | Line | Data |
---|---|---|
215a7ad1 JH |
1 | git-reset(1) |
2 | ============ | |
7fc9d69f JH |
3 | |
4 | NAME | |
5 | ---- | |
215a7ad1 | 6 | git-reset - Reset current HEAD to the specified state. |
7fc9d69f JH |
7 | |
8 | SYNOPSIS | |
9 | -------- | |
215a7ad1 | 10 | 'git-reset' [--mixed | --soft | --hard] [<commit-ish>] |
7fc9d69f JH |
11 | |
12 | DESCRIPTION | |
13 | ----------- | |
f67545ea LAS |
14 | Sets the current head to the specified commit and optionally resets the |
15 | index and working tree to match. | |
7fc9d69f | 16 | |
936a2342 AE |
17 | This command is useful if you notice some small error in a recent |
18 | commit (or set of commits) and want to redo that part without showing | |
19 | the undo in the history. | |
20 | ||
21 | If you want to undo a commit other than the latest on a branch, | |
22 | gitlink:git-revert[1] is your friend. | |
23 | ||
7fc9d69f JH |
24 | OPTIONS |
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 | |
45 | Author | |
46 | ------ | |
47 | Written by Junio C Hamano <junkio@cox.net> and Linus Torvalds <torvalds@osdl.org> | |
48 | ||
49 | Documentation | |
50 | -------------- | |
51 | Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. | |
52 | ||
53 | GIT | |
54 | --- | |
a7154e91 | 55 | Part of the gitlink:git[7] suite |
7fc9d69f | 56 |