title: How to find the last branch checked out in git
body: <p>We can checkout the last branch using <code>git checkout -</code>, but is there a way to just find out what was last branch and not check it out?</p>
  
  <p>EDIT:
  I already found that I could use: </p>
  
  <pre><code>git reflog | grep -i "checkout: moving"|head -1|cut -d' ' -f6
  </code></pre>
  
  <p>But I wanted to know if there is a direct simpler command. I am updating the question to reflect this need. Sorry about not being clear enough</p>