title: Git: change HEAD
body: <p>I have a repository on Bitbuket with two branches:</p>
  
  <pre><code> $ git branch -a
  * master
    remotes/origin/HEAD -&gt; origin/master
    remotes/origin/master
    remotes/origin/ng-1
  </code></pre>
  
  <p><code>master</code> contains old tool code, and <code>ng-1</code> - new.</p>
  
  <p>What I want to do - is switch <code>master</code> to <code>ng-1</code> so when <code>git pull</code> will be executed - it will pull code from <code>"master"</code> - but with new code.</p>
  
  <p>Let's say - I want "move" code from <code>master</code> to <code>ng-1</code> - and from <code>ng-1</code> to <code>master</code>.</p>
  
  <p>As I googled - this can be done with:</p>
  
  <pre><code>$ git update-ref HEAD ng-1
  </code></pre>
  
  <p>Thus - "main default" branch will became <code>ng-1</code> and <code>master</code> will be saved as my "backup".</p>
  
  <p>If something will go wrong - I'll can just do vice versa:</p>
  
  <pre><code>$ git update-ref HEAD master
  </code></pre>
  
  <p>Am I correct?</p>