title: Accidentally created new branch with existing name
body: <p>I'm just starting to use branches with git, and I created yesterday a branch <code>foo</code> and pushed it to the remote. Today I wanted to work on it from home, so after running a pull I typed without thinking <code>git checkout -b foo</code>. </p>
  
  <p>I know I shouldn't have added the <code>-b</code> option, because I got a message <code>Switched to a new branch 'foo'</code> and none of the code I wrote yesterday shows up in my folders so I figure I accidentally messed up the branch names.</p>
  
  <p>I tried <a href="https://stackoverflow.com/questions/6591213/how-do-you-rename-the-local-branch">renaming</a> the branch using <code>git branch -m foo bar</code> hoping that it would deal with the local branch only and deduplicate the branch names, but alas <code>git checkout foo</code> issued the message <code>error: pathspec 'foo' did not match any file(s) known to git.</code></p>
  
  <p>How can I retrieve the branch I created yesterday?</p>