<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 11, 2013 at 6:01 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><font face="courier new, monospace">master ~/petsc$ git checkout b95f98c</font></div>
<div><font face="courier new, monospace">Note: checking out 'b95f98c'.</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">You are in 'detached HEAD' state. You can look around, make experimental</font></div>

<div><font face="courier new, monospace">changes and commit them, and you can discard any commits you make in this</font></div><div><font face="courier new, monospace">state without impacting any branches by performing another checkout.</font></div>

<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">If you want to create a new branch to retain commits you create, you may</font></div><div><font face="courier new, monospace">do so (now or later) by using -b with the checkout command again. Example:</font></div>

<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">  git checkout -b new_branch_name</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">HEAD is now at b95f98c... Merge subtree 'buildsystem/master'</font></div>
</blockquote></div><br>Additionally, every place HEAD has been (which includes any commits you make, etc) is remembered for 90 days (default). So if you commit something here (with a detached HEAD), then switch away, do other stuff, and later want to find it, it will still be in the reflog</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><font face="courier new, monospace">$ git reflog --grep "something relevant"</font></div></div>