title: git switch branch without discarding local changes
body: <p>Alright, lets say one day we make happen to make a bunch of modifications and when we go to commit them we notice we were working on the wrong branch.</p>
  
  <p>How can we force git to switch branches <strong>without discarding local changes</strong>.</p>
  
  <p>I'm probably going to go about this in a naive way while I wait a reply, but I would like to know if theres a correct procedure as I'd be lying if I said this hasn't happened to me before...</p>
  
  <ul>
  <li>Backup changed repo</li>
  <li><code>git reset --hard</code></li>
  <li><code>git checkout right-branch</code></li>
  <li>Restore changes</li>
  <li><code>git commit -m "changes"</code></li>
  </ul>