title: How do I git reset --hard origin/whatever branch I have checked out?
body: <p>I'm trying to write a git deployment script, but the script has to update several servers and they aren't all on the same Git branch.  Ideally the script should need just one command, to the effect of "git reset --hard origin/whateverBranchThisServerIsOn".</p>
  
  <p>Now, I understand that I can do:</p>
  
  <pre><code>git reset --hard origin/foo
  </code></pre>
  
  <p>to reset my git environment to the remote foo branch.  However, what I'd like to do is reset to a remote branch, but not "foo" specifically, just "the remote of whatever branch the machine currently has checked out (ie. what branch shows up when you do <code>git branch</code>".</p>
  
  <p>I've tried:</p>
  
  <pre><code>git reset --hard origin
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>git reset --hard origin/HEAD
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>git reset --hard HEAD
  </code></pre>
  
  <p>but they all either checkout other branches, or (in the last case) don't get the remote commits.  Surely there is some way to say <code>git reset --hard origin/CURRENT_BRANCH</code>?</p>