Autogenerated HTML docs for v1.7.3-rc0-38-g9ab5a
[git/jnareb-git.git] / git-reset.html
blob93b664cd3d17c1e1ab4f1589a90d0e73636a1457
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="generator" content="AsciiDoc 8.2.5" />
7 <style type="text/css">
8 /* Debug borders */
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11 border: 1px solid red;
15 body {
16 margin: 1em 5% 1em 5%;
19 a {
20 color: blue;
21 text-decoration: underline;
23 a:visited {
24 color: fuchsia;
27 em {
28 font-style: italic;
31 strong {
32 font-weight: bold;
35 tt {
36 color: navy;
39 h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
47 h1, h2, h3 {
48 border-bottom: 2px solid silver;
50 h2 {
51 padding-top: 0.5em;
53 h3 {
54 float: left;
56 h3 + * {
57 clear: left;
60 div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
65 hr {
66 border: 1px solid silver;
69 p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
74 pre {
75 padding: 0;
76 margin: 0;
79 span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
83 font-size: 1.1em;
85 span#email {
87 span#revision {
88 font-family: sans-serif;
91 div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
98 div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
102 div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
107 div#preamble,
108 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110 div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
115 div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
120 div.content { /* Block element content. */
121 padding: 0;
124 /* Block element titles. */
125 div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
132 div.title + * {
133 margin-top: 0;
136 td div.title:first-child {
137 margin-top: 0.0em;
139 div.content div.title:first-child {
140 margin-top: 0.0em;
142 div.content + div.title {
143 margin-top: 0.0em;
146 div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
152 div.listingblock {
153 margin-right: 0%;
155 div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
161 div.quoteblock > div.content {
162 padding-left: 2.0em;
165 div.attribution {
166 text-align: right;
168 div.verseblock + div.attribution {
169 text-align: left;
172 div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
180 div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
185 div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
190 div.verseblock div.content {
191 white-space: pre;
194 div.imageblock div.content { padding-left: 0; }
195 div.imageblock img { border: 1px solid silver; }
196 span.image img { border-style: none; }
198 dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
202 dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
207 dd > *:first-child {
208 margin-top: 0;
211 ul, ol {
212 list-style-position: outside;
214 div.olist2 ol {
215 list-style-type: lower-alpha;
218 div.tableblock > table {
219 border: 3px solid #527bbd;
221 thead {
222 font-family: sans-serif;
223 font-weight: bold;
225 tfoot {
226 font-weight: bold;
229 div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
233 div.hlist td {
234 padding-bottom: 5px;
236 td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
241 td.hlist2 {
242 vertical-align: top;
245 @media print {
246 div#footer-badges { display: none; }
249 div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
258 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
262 div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
266 div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
270 div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
274 include1::./stylesheets/xhtml11-manpage.css[]
275 /* Workarounds for IE6's broken and incomplete CSS2. */
277 div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
282 div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
289 div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
295 div.quoteblock-content {
296 padding-left: 2.0em;
299 div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
304 /* IE6 sets dynamically generated links as visited. */
305 div#toc a:visited { color: blue; }
306 </style>
307 <title>git-reset(1)</title>
308 </head>
309 <body>
310 <div id="header">
311 <h1>
312 git-reset(1) Manual Page
313 </h1>
314 <h2>NAME</h2>
315 <div class="sectionbody">
316 <p>git-reset -
317 Reset current HEAD to the specified state
318 </p>
319 </div>
320 </div>
321 <h2>SYNOPSIS</h2>
322 <div class="sectionbody">
323 <div class="verseblock">
324 <div class="content"><em>git reset</em> [-q] [&lt;commit&gt;] [--] &lt;paths&gt;&#8230;
325 <em>git reset</em> --patch [&lt;commit&gt;] [--] [&lt;paths&gt;&#8230;]
326 <em>git reset</em> [--soft | --mixed | --hard | --merge | --keep] [-q] [&lt;commit&gt;]</div></div>
327 </div>
328 <h2 id="_description">DESCRIPTION</h2>
329 <div class="sectionbody">
330 <div class="para"><p>In the first and second form, copy entries from &lt;commit&gt; to the index.
331 In the third form, set the current branch to &lt;commit&gt;, optionally
332 modifying index and worktree to match. The &lt;commit&gt; defaults to HEAD
333 in all forms.</p></div>
334 <div class="vlist"><dl>
335 <dt>
336 <em>git reset</em> [-q] [&lt;commit&gt;] [--] &lt;paths&gt;&#8230;
337 </dt>
338 <dd>
340 This form resets the index entries for all &lt;paths&gt; to their
341 state at the &lt;commit&gt;. (It does not affect the worktree, nor
342 the current branch.)
343 </p>
344 <div class="para"><p>This means that <tt>git reset &lt;paths&gt;</tt> is the opposite of <tt>git add
345 &lt;paths&gt;</tt>.</p></div>
346 </dd>
347 <dt>
348 <em>git reset</em> --patch|-p [&lt;commit&gt;] [--] [&lt;paths&gt;&#8230;]
349 </dt>
350 <dd>
352 Interactively select hunks in the difference between the index
353 and &lt;commit&gt; (defaults to HEAD). The chosen hunks are applied
354 in reverse to the index.
355 </p>
356 <div class="para"><p>This means that <tt>git reset -p</tt> is the opposite of <tt>git add -p</tt> (see
357 <a href="git-add.html">git-add(1)</a>).</p></div>
358 </dd>
359 <dt>
360 <em>git reset</em> [--&lt;mode&gt;] [&lt;commit&gt;]
361 </dt>
362 <dd>
364 This form points the current branch to &lt;commit&gt; and then
365 updates index and working tree according to &lt;mode&gt;, which must
366 be one of the following:
367 </p>
368 <div class="vlist"><dl>
369 <dt>
370 --soft
371 </dt>
372 <dd>
374 Does not touch the index file nor the working tree at all, but
375 requires them to be in a good order. This leaves all your changed
376 files "Changes to be committed", as <em>git status</em> would
377 put it.
378 </p>
379 </dd>
380 <dt>
381 --mixed
382 </dt>
383 <dd>
385 Resets the index but not the working tree (i.e., the changed files
386 are preserved but not marked for commit) and reports what has not
387 been updated. This is the default action.
388 </p>
389 </dd>
390 <dt>
391 --hard
392 </dt>
393 <dd>
395 Matches the working tree and index to that of the tree being
396 switched to. Any changes to tracked files in the working tree
397 since &lt;commit&gt; are lost.
398 </p>
399 </dd>
400 <dt>
401 --merge
402 </dt>
403 <dd>
405 Resets the index to match the tree recorded by the named commit,
406 and updates the files that are different between the named commit
407 and the current commit in the working tree.
408 </p>
409 </dd>
410 <dt>
411 --keep
412 </dt>
413 <dd>
415 Reset the index to the given commit, keeping local changes in
416 the working tree since the current commit, while updating
417 working tree files without local changes to what appears in
418 the given commit. If a file that is different between the
419 current commit and the given commit has local changes, reset
420 is aborted.
421 </p>
422 </dd>
423 </dl></div>
424 </dd>
425 </dl></div>
426 <div class="para"><p>If you want to undo a commit other than the latest on a branch,
427 <a href="git-revert.html">git-revert(1)</a> is your friend.</p></div>
428 </div>
429 <h2 id="_options">OPTIONS</h2>
430 <div class="sectionbody">
431 <div class="vlist"><dl>
432 <dt>
434 </dt>
435 <dt>
436 --quiet
437 </dt>
438 <dd>
440 Be quiet, only report errors.
441 </p>
442 </dd>
443 </dl></div>
444 </div>
445 <h2 id="_examples">EXAMPLES</h2>
446 <div class="sectionbody">
447 <div class="vlist"><dl>
448 <dt>
449 Undo add
450 </dt>
451 <dd>
452 <div class="listingblock">
453 <div class="content">
454 <pre><tt>$ edit <b>(1)</b>
455 $ git add frotz.c filfre.c
456 $ mailx <b>(2)</b>
457 $ git reset <b>(3)</b>
458 $ git pull git://info.example.com/ nitfol <b>(4)</b></tt></pre>
459 </div></div>
460 <div class="colist"><ol>
461 <li>
463 You are happily working on something, and find the changes
464 in these files are in good order. You do not want to see them
465 when you run "git diff", because you plan to work on other files
466 and changes with these files are distracting.
467 </p>
468 </li>
469 <li>
471 Somebody asks you to pull, and the changes sounds worthy of merging.
472 </p>
473 </li>
474 <li>
476 However, you already dirtied the index (i.e. your index does
477 not match the HEAD commit). But you know the pull you are going
478 to make does not affect frotz.c nor filfre.c, so you revert the
479 index changes for these two files. Your changes in working tree
480 remain there.
481 </p>
482 </li>
483 <li>
485 Then you can pull and merge, leaving frotz.c and filfre.c
486 changes still in the working tree.
487 </p>
488 </li>
489 </ol></div>
490 </dd>
491 <dt>
492 Undo a commit and redo
493 </dt>
494 <dd>
495 <div class="listingblock">
496 <div class="content">
497 <pre><tt>$ git commit ...
498 $ git reset --soft HEAD^ <b>(1)</b>
499 $ edit <b>(2)</b>
500 $ git commit -a -c ORIG_HEAD <b>(3)</b></tt></pre>
501 </div></div>
502 <div class="colist"><ol>
503 <li>
505 This is most often done when you remembered what you
506 just committed is incomplete, or you misspelled your commit
507 message, or both. Leaves working tree as it was before "reset".
508 </p>
509 </li>
510 <li>
512 Make corrections to working tree files.
513 </p>
514 </li>
515 <li>
517 "reset" copies the old head to .git/ORIG_HEAD; redo the
518 commit by starting with its log message. If you do not need to
519 edit the message further, you can give -C option instead.
520 </p>
521 <div class="para"><p>See also the --amend option to <a href="git-commit.html">git-commit(1)</a>.</p></div>
522 </li>
523 </ol></div>
524 </dd>
525 <dt>
526 Undo a commit, making it a topic branch
527 </dt>
528 <dd>
529 <div class="listingblock">
530 <div class="content">
531 <pre><tt>$ git branch topic/wip <b>(1)</b>
532 $ git reset --hard HEAD~3 <b>(2)</b>
533 $ git checkout topic/wip <b>(3)</b></tt></pre>
534 </div></div>
535 <div class="colist"><ol>
536 <li>
538 You have made some commits, but realize they were premature
539 to be in the "master" branch. You want to continue polishing
540 them in a topic branch, so create "topic/wip" branch off of the
541 current HEAD.
542 </p>
543 </li>
544 <li>
546 Rewind the master branch to get rid of those three commits.
547 </p>
548 </li>
549 <li>
551 Switch to "topic/wip" branch and keep working.
552 </p>
553 </li>
554 </ol></div>
555 </dd>
556 <dt>
557 Undo commits permanently
558 </dt>
559 <dd>
560 <div class="listingblock">
561 <div class="content">
562 <pre><tt>$ git commit ...
563 $ git reset --hard HEAD~3 <b>(1)</b></tt></pre>
564 </div></div>
565 <div class="colist"><ol>
566 <li>
568 The last three commits (HEAD, HEAD^, and HEAD~2) were bad
569 and you do not want to ever see them again. Do <strong>not</strong> do this if
570 you have already given these commits to somebody else. (See the
571 "RECOVERING FROM UPSTREAM REBASE" section in <a href="git-rebase.html">git-rebase(1)</a> for
572 the implications of doing so.)
573 </p>
574 </li>
575 </ol></div>
576 </dd>
577 <dt>
578 Undo a merge or pull
579 </dt>
580 <dd>
581 <div class="listingblock">
582 <div class="content">
583 <pre><tt>$ git pull <b>(1)</b>
584 Auto-merging nitfol
585 CONFLICT (content): Merge conflict in nitfol
586 Automatic merge failed; fix conflicts and then commit the result.
587 $ git reset --hard <b>(2)</b>
588 $ git pull . topic/branch <b>(3)</b>
589 Updating from 41223... to 13134...
590 Fast-forward
591 $ git reset --hard ORIG_HEAD <b>(4)</b></tt></pre>
592 </div></div>
593 <div class="colist"><ol>
594 <li>
596 Try to update from the upstream resulted in a lot of
597 conflicts; you were not ready to spend a lot of time merging
598 right now, so you decide to do that later.
599 </p>
600 </li>
601 <li>
603 "pull" has not made merge commit, so "git reset --hard"
604 which is a synonym for "git reset --hard HEAD" clears the mess
605 from the index file and the working tree.
606 </p>
607 </li>
608 <li>
610 Merge a topic branch into the current branch, which resulted
611 in a fast-forward.
612 </p>
613 </li>
614 <li>
616 But you decided that the topic branch is not ready for public
617 consumption yet. "pull" or "merge" always leaves the original
618 tip of the current branch in ORIG_HEAD, so resetting hard to it
619 brings your index file and the working tree back to that state,
620 and resets the tip of the branch to that commit.
621 </p>
622 </li>
623 </ol></div>
624 </dd>
625 <dt>
626 Undo a merge or pull inside a dirty work tree
627 </dt>
628 <dd>
629 <div class="listingblock">
630 <div class="content">
631 <pre><tt>$ git pull <b>(1)</b>
632 Auto-merging nitfol
633 Merge made by recursive.
634 nitfol | 20 +++++----
636 $ git reset --merge ORIG_HEAD <b>(2)</b></tt></pre>
637 </div></div>
638 <div class="colist"><ol>
639 <li>
641 Even if you may have local modifications in your
642 working tree, you can safely say "git pull" when you know
643 that the change in the other branch does not overlap with
644 them.
645 </p>
646 </li>
647 <li>
649 After inspecting the result of the merge, you may find
650 that the change in the other branch is unsatisfactory. Running
651 "git reset --hard ORIG_HEAD" will let you go back to where you
652 were, but it will discard your local changes, which you do not
653 want. "git reset --merge" keeps your local changes.
654 </p>
655 </li>
656 </ol></div>
657 </dd>
658 <dt>
659 Interrupted workflow
660 </dt>
661 <dd>
662 <div class="para"><p>Suppose you are interrupted by an urgent fix request while you
663 are in the middle of a large change. The files in your
664 working tree are not in any shape to be committed yet, but you
665 need to get to the other branch for a quick bugfix.</p></div>
666 <div class="listingblock">
667 <div class="content">
668 <pre><tt>$ git checkout feature ;# you were working in "feature" branch and
669 $ work work work ;# got interrupted
670 $ git commit -a -m "snapshot WIP" <b>(1)</b>
671 $ git checkout master
672 $ fix fix fix
673 $ git commit ;# commit with real log
674 $ git checkout feature
675 $ git reset --soft HEAD^ ;# go back to WIP state <b>(2)</b>
676 $ git reset <b>(3)</b></tt></pre>
677 </div></div>
678 <div class="colist"><ol>
679 <li>
681 This commit will get blown away so a throw-away log message is OK.
682 </p>
683 </li>
684 <li>
686 This removes the <em>WIP</em> commit from the commit history, and sets
687 your working tree to the state just before you made that snapshot.
688 </p>
689 </li>
690 <li>
692 At this point the index file still has all the WIP changes you
693 committed as <em>snapshot WIP</em>. This updates the index to show your
694 WIP files as uncommitted.
695 </p>
696 <div class="para"><p>See also <a href="git-stash.html">git-stash(1)</a>.</p></div>
697 </li>
698 </ol></div>
699 </dd>
700 <dt>
701 Reset a single file in the index
702 </dt>
703 <dd>
704 <div class="para"><p>Suppose you have added a file to your index, but later decide you do not
705 want to add it to your commit. You can remove the file from the index
706 while keeping your changes with git reset.</p></div>
707 <div class="listingblock">
708 <div class="content">
709 <pre><tt>$ git reset -- frotz.c <b>(1)</b>
710 $ git commit -m "Commit files in index" <b>(2)</b>
711 $ git add frotz.c <b>(3)</b></tt></pre>
712 </div></div>
713 <div class="colist"><ol>
714 <li>
716 This removes the file from the index while keeping it in the working
717 directory.
718 </p>
719 </li>
720 <li>
722 This commits all other changes in the index.
723 </p>
724 </li>
725 <li>
727 Adds the file to the index again.
728 </p>
729 </li>
730 </ol></div>
731 </dd>
732 <dt>
733 Keep changes in working tree while discarding some previous commits
734 </dt>
735 <dd>
736 <div class="para"><p>Suppose you are working on something and you commit it, and then you
737 continue working a bit more, but now you think that what you have in
738 your working tree should be in another branch that has nothing to do
739 with what you committed previously. You can start a new branch and
740 reset it while keeping the changes in your work tree.</p></div>
741 <div class="listingblock">
742 <div class="content">
743 <pre><tt>$ git tag start
744 $ git checkout -b branch1
745 $ edit
746 $ git commit ... <b>(1)</b>
747 $ edit
748 $ git checkout -b branch2 <b>(2)</b>
749 $ git reset --keep start <b>(3)</b></tt></pre>
750 </div></div>
751 <div class="colist"><ol>
752 <li>
754 This commits your first edits in branch1.
755 </p>
756 </li>
757 <li>
759 In the ideal world, you could have realized that the earlier
760 commit did not belong to the new topic when you created and switched
761 to branch2 (i.e. "git checkout -b branch2 start"), but nobody is
762 perfect.
763 </p>
764 </li>
765 <li>
767 But you can use "reset --keep" to remove the unwanted commit after
768 you switched to "branch2".
769 </p>
770 </li>
771 </ol></div>
772 </dd>
773 </dl></div>
774 </div>
775 <h2 id="_discussion">DISCUSSION</h2>
776 <div class="sectionbody">
777 <div class="para"><p>The tables below show what happens when running:</p></div>
778 <div class="listingblock">
779 <div class="content">
780 <pre><tt>git reset --option target</tt></pre>
781 </div></div>
782 <div class="para"><p>to reset the HEAD to another commit (<tt>target</tt>) with the different
783 reset options depending on the state of the files.</p></div>
784 <div class="para"><p>In these tables, A, B, C and D are some different states of a
785 file. For example, the first line of the first table means that if a
786 file is in state A in the working tree, in state B in the index, in
787 state C in HEAD and in state D in the target, then "git reset --soft
788 target" will put the file in state A in the working tree, in state B
789 in the index and in state D in HEAD.</p></div>
790 <div class="literalblock">
791 <div class="content">
792 <pre><tt>working index HEAD target working index HEAD
793 ----------------------------------------------------
794 A B C D --soft A B D
795 --mixed A D D
796 --hard D D D
797 --merge (disallowed)
798 --keep (disallowed)</tt></pre>
799 </div></div>
800 <div class="literalblock">
801 <div class="content">
802 <pre><tt>working index HEAD target working index HEAD
803 ----------------------------------------------------
804 A B C C --soft A B C
805 --mixed A C C
806 --hard C C C
807 --merge (disallowed)
808 --keep A C C</tt></pre>
809 </div></div>
810 <div class="literalblock">
811 <div class="content">
812 <pre><tt>working index HEAD target working index HEAD
813 ----------------------------------------------------
814 B B C D --soft B B D
815 --mixed B D D
816 --hard D D D
817 --merge D D D
818 --keep (disallowed)</tt></pre>
819 </div></div>
820 <div class="literalblock">
821 <div class="content">
822 <pre><tt>working index HEAD target working index HEAD
823 ----------------------------------------------------
824 B B C C --soft B B C
825 --mixed B C C
826 --hard C C C
827 --merge C C C
828 --keep B C C</tt></pre>
829 </div></div>
830 <div class="literalblock">
831 <div class="content">
832 <pre><tt>working index HEAD target working index HEAD
833 ----------------------------------------------------
834 B C C D --soft B C D
835 --mixed B D D
836 --hard D D D
837 --merge (disallowed)
838 --keep (disallowed)</tt></pre>
839 </div></div>
840 <div class="literalblock">
841 <div class="content">
842 <pre><tt>working index HEAD target working index HEAD
843 ----------------------------------------------------
844 B C C C --soft B C C
845 --mixed B C C
846 --hard C C C
847 --merge B C C
848 --keep B C C</tt></pre>
849 </div></div>
850 <div class="para"><p>"reset --merge" is meant to be used when resetting out of a conflicted
851 merge. Any mergy operation guarantees that the work tree file that is
852 involved in the merge does not have local change wrt the index before
853 it starts, and that it writes the result out to the work tree. So if
854 we see some difference between the index and the target and also
855 between the index and the work tree, then it means that we are not
856 resetting out from a state that a mergy operation left after failing
857 with a conflict. That is why we disallow --merge option in this case.</p></div>
858 <div class="para"><p>"reset --keep" is meant to be used when removing some of the last
859 commits in the current branch while keeping changes in the working
860 tree. If there could be conflicts between the changes in the commit we
861 want to remove and the changes in the working tree we want to keep,
862 the reset is disallowed. That's why it is disallowed if there are both
863 changes between the working tree and HEAD, and between HEAD and the
864 target. To be safe, it is also disallowed when there are unmerged
865 entries.</p></div>
866 <div class="para"><p>The following tables show what happens when there are unmerged
867 entries:</p></div>
868 <div class="literalblock">
869 <div class="content">
870 <pre><tt>working index HEAD target working index HEAD
871 ----------------------------------------------------
872 X U A B --soft (disallowed)
873 --mixed X B B
874 --hard B B B
875 --merge B B B
876 --keep (disallowed)</tt></pre>
877 </div></div>
878 <div class="literalblock">
879 <div class="content">
880 <pre><tt>working index HEAD target working index HEAD
881 ----------------------------------------------------
882 X U A A --soft (disallowed)
883 --mixed X A A
884 --hard A A A
885 --merge A A A
886 --keep (disallowed)</tt></pre>
887 </div></div>
888 <div class="para"><p>X means any state and U means an unmerged index.</p></div>
889 </div>
890 <h2 id="_author">Author</h2>
891 <div class="sectionbody">
892 <div class="para"><p>Written by Junio C Hamano &lt;gitster@pobox.com&gt; and Linus Torvalds &lt;torvalds@osdl.org&gt;</p></div>
893 </div>
894 <h2 id="_documentation">Documentation</h2>
895 <div class="sectionbody">
896 <div class="para"><p>Documentation by Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
897 </div>
898 <h2 id="_git">GIT</h2>
899 <div class="sectionbody">
900 <div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
901 </div>
902 <div id="footer">
903 <div id="footer-text">
904 Last updated 2010-09-03 21:30:29 UTC
905 </div>
906 </div>
907 </body>
908 </html>