Autogenerated HTML docs for v1.3.3-g441c8
[git.git] / git-reset.html
index 915201d..c76cd08 100644 (file)
@@ -3,7 +3,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
 <head>\r
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
-<meta name="generator" content="AsciiDoc 7.0.1" />\r
+<meta name="generator" content="AsciiDoc 7.0.2" />\r
 <style type="text/css">\r
 /* Debug borders */\r
 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {\r
@@ -266,7 +266,7 @@ git-reset(1) Manual Page
 <h2>NAME</h2>\r
 <div class="sectionbody">\r
 <p>git-reset -\r
-   Reset current HEAD to the specified state.\r
+   Reset current HEAD to the specified state\r
 </p>\r
 </div>\r
 </div>\r
@@ -292,7 +292,7 @@ the undo in the history.</p>
 </dt>\r
 <dd>\r
 <p>\r
-        Resets the index but not the working tree (ie, the changed files\r
+        Resets the index but not the working tree (i.e., the changed files\r
         are preserved but not marked for commit) and reports what has not\r
         been updated. This is the default action.\r
 </p>\r
@@ -327,7 +327,9 @@ the undo in the history.</p>
 </p>\r
 </dd>\r
 </dl>\r
-<h3>Examples</h3>\r
+</div>\r
+<h2>Examples</h2>\r
+<div class="sectionbody">\r
 <dl>\r
 <dt>\r
 Undo a commit and redo\r
@@ -336,18 +338,31 @@ Undo a commit and redo
 <div class="listingblock">\r
 <div class="content">\r
 <pre><tt>$ git commit ...\r
-$ git reset --soft HEAD^ <b>(1)</b>\r
-$ edit <b>(2)</b>\r
-$ git commit -a -c ORIG_HEAD <b>(3)</b>\r
-\r
-<b>(1)</b> This is most often done when you remembered what you\r
+$ git reset --soft HEAD^      <b>(1)</b>\r
+$ edit                        <b>(2)</b>\r
+$ git commit -a -c ORIG_HEAD  <b>(3)</b></tt></pre>\r
+</div></div>\r
+<ol>\r
+<li>\r
+<p>\r
+This is most often done when you remembered what you\r
 just committed is incomplete, or you misspelled your commit\r
 message, or both.  Leaves working tree as it was before "reset".\r
-<b>(2)</b> make corrections to working tree files.\r
-<b>(3)</b> "reset" copies the old head to .git/ORIG_HEAD; redo the\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+make corrections to working tree files.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+"reset" copies the old head to .git/ORIG_HEAD; redo the\r
 commit by starting with its log message.  If you do not need to\r
-edit the message further, you can give -C option instead.</tt></pre>\r
-</div></div>\r
+edit the message further, you can give -C option instead.\r
+</p>\r
+</li>\r
+</ol>\r
 </dd>\r
 <dt>\r
 Undo commits permanently\r
@@ -356,12 +371,17 @@ Undo commits permanently
 <div class="listingblock">\r
 <div class="content">\r
 <pre><tt>$ git commit ...\r
-$ git reset --hard HEAD~3 <b>(1)</b>\r
-\r
-<b>(1)</b> The last three commits (HEAD, HEAD^, and HEAD~2) were bad\r
-and you do not want to ever see them again.  Do *not* do this if\r
-you have already given these commits to somebody else.</tt></pre>\r
+$ git reset --hard HEAD~3   <b>(1)</b></tt></pre>\r
 </div></div>\r
+<ol>\r
+<li>\r
+<p>\r
+The last three commits (HEAD, HEAD^, and HEAD~2) were bad\r
+and you do not want to ever see them again.  Do <strong>not</strong> do this if\r
+you have already given these commits to somebody else.\r
+</p>\r
+</li>\r
+</ol>\r
 </dd>\r
 <dt>\r
 Undo a commit, making it a topic branch\r
@@ -369,17 +389,30 @@ Undo a commit, making it a topic branch
 <dd>\r
 <div class="listingblock">\r
 <div class="content">\r
-<pre><tt>$ git branch topic/wip <b>(1)</b>\r
-$ git reset --hard HEAD~3 <b>(2)</b>\r
-$ git checkout topic/wip <b>(3)</b>\r
-\r
-<b>(1)</b> You have made some commits, but realize they were premature\r
+<pre><tt>$ git branch topic/wip     <b>(1)</b>\r
+$ git reset --hard HEAD~3  <b>(2)</b>\r
+$ git checkout topic/wip   <b>(3)</b></tt></pre>\r
+</div></div>\r
+<ol>\r
+<li>\r
+<p>\r
+You have made some commits, but realize they were premature\r
 to be in the "master" branch.  You want to continue polishing\r
 them in a topic branch, so create "topic/wip" branch off of the\r
 current HEAD.\r
-<b>(2)</b> Rewind the master branch to get rid of those three commits.\r
-<b>(3)</b> Switch to "topic/wip" branch and keep working.</tt></pre>\r
-</div></div>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Rewind the master branch to get rid of those three commits.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Switch to "topic/wip" branch and keep working.\r
+</p>\r
+</li>\r
+</ol>\r
 </dd>\r
 <dt>\r
 Undo update-index\r
@@ -387,25 +420,42 @@ Undo update-index
 <dd>\r
 <div class="listingblock">\r
 <div class="content">\r
-<pre><tt>$ edit <b>(1)</b>\r
+<pre><tt>$ edit                                     <b>(1)</b>\r
 $ git-update-index frotz.c filfre.c\r
-$ mailx <b>(2)</b>\r
-$ git reset <b>(3)</b>\r
-$ git pull git://info.example.com/ nitfol <b>(4)</b>\r
-\r
-<b>(1)</b> you are happily working on something, and find the changes\r
+$ mailx                                    <b>(2)</b>\r
+$ git reset                                <b>(3)</b>\r
+$ git pull git://info.example.com/ nitfol  <b>(4)</b></tt></pre>\r
+</div></div>\r
+<ol>\r
+<li>\r
+<p>\r
+you are happily working on something, and find the changes\r
 in these files are in good order.  You do not want to see them\r
 when you run "git diff", because you plan to work on other files\r
 and changes with these files are distracting.\r
-<b>(2)</b> somebody asks you to pull, and the changes sounds worthy of merging.\r
-<b>(3)</b> however, you already dirtied the index (i.e. your index does\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+somebody asks you to pull, and the changes sounds worthy of merging.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+however, you already dirtied the index (i.e. your index does\r
 not match the HEAD commit).  But you know the pull you are going\r
 to make does not affect frotz.c nor filfre.c, so you revert the\r
 index changes for these two files.  Your changes in working tree\r
 remain there.\r
-<b>(4)</b> then you can pull and merge, leaving frotz.c and filfre.c\r
-changes still in the working tree.</tt></pre>\r
-</div></div>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+then you can pull and merge, leaving frotz.c and filfre.c\r
+changes still in the working tree.\r
+</p>\r
+</li>\r
+</ol>\r
 </dd>\r
 <dt>\r
 Undo a merge or pull\r
@@ -413,7 +463,7 @@ Undo a merge or pull
 <dd>\r
 <div class="listingblock">\r
 <div class="content">\r
-<pre><tt>$ git pull <b>(1)</b>\r
+<pre><tt>$ git pull                         <b>(1)</b>\r
 Trying really trivial in-index merge...\r
 fatal: Merge requires file-level merging\r
 Nope.\r
@@ -421,28 +471,43 @@ Nope.
 Auto-merging nitfol\r
 CONFLICT (content): Merge conflict in nitfol\r
 Automatic merge failed/prevented; fix up by hand\r
-$ git reset --hard <b>(2)</b>\r
-\r
-<b>(1)</b> try to update from the upstream resulted in a lot of\r
+$ git reset --hard                 <b>(2)</b>\r
+$ git pull . topic/branch          <b>(3)</b>\r
+Updating from 41223... to 13134...\r
+Fast forward\r
+$ git reset --hard ORIG_HEAD       <b>(4)</b></tt></pre>\r
+</div></div>\r
+<ol>\r
+<li>\r
+<p>\r
+try to update from the upstream resulted in a lot of\r
 conflicts; you were not ready to spend a lot of time merging\r
 right now, so you decide to do that later.\r
-<b>(2)</b> "pull" has not made merge commit, so "git reset --hard"\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+"pull" has not made merge commit, so "git reset --hard"\r
 which is a synonym for "git reset --hard HEAD" clears the mess\r
 from the index file and the working tree.\r
-\r
-$ git pull . topic/branch <b>(3)</b>\r
-Updating from 41223... to 13134...\r
-Fast forward\r
-$ git reset --hard ORIG_HEAD <b>(4)</b>\r
-\r
-<b>(3)</b> merge a topic branch into the current branch, which resulted\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+merge a topic branch into the current branch, which resulted\r
 in a fast forward.\r
-<b>(4)</b> but you decided that the topic branch is not ready for public\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+but you decided that the topic branch is not ready for public\r
 consumption yet.  "pull" or "merge" always leaves the original\r
 tip of the current branch in ORIG_HEAD, so resetting hard to it\r
 brings your index file and the working tree back to that state,\r
-and resets the tip of the branch to that commit.</tt></pre>\r
-</div></div>\r
+and resets the tip of the branch to that commit.\r
+</p>\r
+</li>\r
+</ol>\r
 </dd>\r
 <dt>\r
 Interrupted workflow\r
@@ -456,21 +521,34 @@ need to get to the other branch for a quick bugfix.</p>
 <div class="content">\r
 <pre><tt>$ git checkout feature ;# you were working in "feature" branch and\r
 $ work work work       ;# got interrupted\r
-$ git commit -a -m 'snapshot WIP' <b>(1)</b>\r
+$ git commit -a -m 'snapshot WIP'                 <b>(1)</b>\r
 $ git checkout master\r
 $ fix fix fix\r
 $ git commit ;# commit with real log\r
 $ git checkout feature\r
-$ git reset --soft HEAD^ ;# go back to WIP state <b>(2)</b>\r
-$ git reset <b>(3)</b>\r
-\r
-<b>(1)</b> This commit will get blown away so a throw-away log message is OK.\r
-<b>(2)</b> This removes the 'WIP' commit from the commit history, and sets\r
-    your working tree to the state just before you made that snapshot.\r
-<b>(3)</b> After <b>(2)</b>, the index file still has all the WIP changes you\r
-    committed in <b>(1)</b>.  This sets it to the last commit you were\r
-    basing the WIP changes on.</tt></pre>\r
+$ git reset --soft HEAD^ ;# go back to WIP state  <b>(2)</b>\r
+$ git reset                                       <b>(3)</b></tt></pre>\r
 </div></div>\r
+<ol>\r
+<li>\r
+<p>\r
+This commit will get blown away so a throw-away log message is OK.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+This removes the <em>WIP</em> commit from the commit history, and sets\r
+    your working tree to the state just before you made that snapshot.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+At this point the index file still has all the WIP changes you\r
+    committed as <em>snapshot WIP</em>.  This updates the index to show your\r
+    WIP files as uncommitted.\r
+</p>\r
+</li>\r
+</ol>\r
 </dd>\r
 </dl>\r
 </div>\r
@@ -488,7 +566,7 @@ $ git reset <b>(3)</b>
 </div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Last updated 21-Jan-2006 23:50:19 PDT\r
+Last updated 04-Jun-2006 07:24:30 UTC\r
 </div>\r
 </div>\r
 </body>\r