title: git delete and recreate branch
body: <p>Abstract: To reproduce the error</p>
  
  <ul>
  <li>create a branch and check it out</li>
  <li>let someone else delete it and create a new branch with the same name</li>
  <li>now do <code>git branch -D &lt;branch&gt;</code> and <code>git checkout -b &lt;branch&gt; --track origin/&lt;branch&gt;</code></li>
  <li>on a <code>git pull</code> you get <code>! [rejected] &lt;branch&gt; -&gt; origin/&lt;branch&gt; (non-fast-forward)</code></li>
  </ul>
  
  <p>to fix it, you have to delete the remote tracking information with <code>git branch -d -r origin/&lt;branch&gt;</code> as well</p>
  
  <hr>
  
  <p>OLD: Someone deleted the develop branch and created it to remove all feature branches and have the master as base again. Then he added some of the feature branches but not some others that made problems.</p>
  
  <p>I did a <code>git branch -D develop</code> and <code>git checkout -b develop --track origin/develop</code>.</p>
  
  <p>When i now try <code>git pull</code> i get a <code>! [rejected]        develop       -&gt; origin/develop  (non-fast-forward)</code></p>
  
  <p>a <code>git remote show origin</code> shows</p>
  
  <pre><code>Local refs configured for 'git push': 
  develop       pushes to develop     (local out of date)
  </code></pre>
  
  <p>i can now do a <code>git fetch origin develop</code> and <code>git merge FETCH_HEAD</code> but then i have some conflicts and he wants to push a lot of things to develop. (maybe the old branch commits?) And with a <code>git reset --hard</code> i'm back where the git pull shows the rejected message .. </p>
  
  <p>How do i checkout the recreated branch best?</p>
  
  <p>EDIT: even when i do <code>git branch -D develop</code> i get with <code>git pull</code>  <code>! [rejected]        develop       -&gt; origin/develop  (non-fast-forward)</code> and <code>git remote show origin</code> said everything (up to date)</p>
  
  <p>EDIT: i didn't recognized it at first, because the commit message was the same, but after a reset the HEAD is on a sha that the remote does not have, so still on the "old" branch ? </p>