title: Sync local git repo with remote in one shot discarding local changes/commits
body: <p>I'm a not a git expert so this might look like a silly question.</p>
  
  <p>I have local and remote repositories, I want to sync my local with the remote repository. I have many local changes, stashed changes, and few commits which are not yet pushed to remote.</p>
  
  <p>One way can be to remove all local changes(using <code>git clean</code>), revert commits and than <code>fetch/pull</code> from remote. But I think there must be some single command which can do all this in one go. I tried using <code>git reset --hard HEAD</code> and then <code>git pull</code> but that gave me: </p>
  
  <pre><code># Your branch and 'origin/master' have diverged,
  # and have 1 and 9 different commits each, respectively.
  </code></pre>
  
  <p>Was looking at <a href="https://stackoverflow.com/questions/6373277/git-sync-local-repo-with-remote-one">this question</a> as well, but didn't help.</p>