summaryrefslogtreecommitdiffstats
path: root/git-checkout.html
diff options
context:
space:
mode:
authorJunio C Hamano <junio@hera.kernel.org>2007-02-13 23:48:20 +0000
committerJunio C Hamano <junio@hera.kernel.org>2007-02-13 23:48:20 +0000
commit9d52e57498c466188232dce375f9f24e983e616e (patch)
tree58e45b4f6cc59112f7f4d5cfcb43b6da658babcf /git-checkout.html
parent78ded48142f45424cec5fbe3cf18802ad96f2202 (diff)
downloadgit-htmldocs-9d52e57498c466188232dce375f9f24e983e616e.tar.gz
Autogenerated HTML docs for v1.5.0-rc4-372-g26cfc
Diffstat (limited to 'git-checkout.html')
-rw-r--r--git-checkout.html23
1 files changed, 7 insertions, 16 deletions
diff --git a/git-checkout.html b/git-checkout.html
index 6557ba4e9..14b659e36 100644
--- a/git-checkout.html
+++ b/git-checkout.html
@@ -395,21 +395,12 @@ by any branch (which is natural --- you are not on any branch).
What this means is that you can discard your temporary commits
and merges by switching back to an existing branch (e.g. <tt>git
checkout master</tt>), and a later <tt>git prune</tt> or <tt>git gc</tt> would
-garbage-collect them.</p>
-<p>The command would refuse to switch back to make sure that you do
-not discard your temporary state by mistake when your detached
-HEAD is not pointed at by any existing ref. If you did want to
-save your state (e.g. "I was interested in the fifth commit from
-the top of <em>master</em> branch", or "I made two commits to fix minor
-bugs while on a detached HEAD" &#8212; and if you do not want to lose
-these facts), you can create a new branch and switch to it with
-<tt>git checkout -b newbranch</tt> so that you can keep building on
-that state, or tag it first so that you can come back to it
-later and switch to the branch you wanted to switch to with <tt>git
-tag that_state; git checkout master</tt>. On the other hand, if you
-did want to discard the temporary state, you can give <tt>-f</tt>
-option (e.g. <tt>git checkout -f master</tt>) to override this
-behaviour.</p>
+garbage-collect them. If you did this by mistake, you can ask
+the reflog for HEAD where you were, e.g.</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ git log -g -2 HEAD</tt></pre>
+</div></div>
</div>
<h2>EXAMPLES</h2>
<div class="sectionbody">
@@ -519,7 +510,7 @@ $ git update-index frotz</tt></pre>
</div>
<div id="footer">
<div id="footer-text">
-Last updated 02-Feb-2007 07:34:52 UTC
+Last updated 13-Feb-2007 23:48:05 UTC
</div>
</div>
</body>