Autogenerated HTML docs for v1.1.4-g9264
[git.git] / git-reset.html
index 7cacfd2..915201d 100644 (file)
@@ -444,6 +444,34 @@ brings your index file and the working tree back to that state,
 and resets the tip of the branch to that commit.</tt></pre>\r
 </div></div>\r
 </dd>\r
+<dt>\r
+Interrupted workflow\r
+</dt>\r
+<dd>\r
+<p>Suppose you are interrupted by an urgent fix request while you\r
+are in the middle of a large change.  The files in your\r
+working tree are not in any shape to be committed yet, but you\r
+need to get to the other branch for a quick bugfix.</p>\r
+<div class="listingblock">\r
+<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 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
+</div></div>\r
+</dd>\r
 </dl>\r
 </div>\r
 <h2>Author</h2>\r
@@ -460,7 +488,7 @@ and resets the tip of the branch to that commit.</tt></pre>
 </div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Last updated 27-Dec-2005 00:16:36 PDT\r
+Last updated 21-Jan-2006 23:50:19 PDT\r
 </div>\r
 </div>\r
 </body>\r