title: GitHub - How to revert changes to previous state
body: <p>I am using GitHub as my remote repository.</p>
  
  <p>I have already pushed 5 commits to the server and want to revert back to the state before the those commits.</p>
  
  <p>If the commit hash is <code>3425661dba2aadccdbab</code>, how do I revert the entire local/remote back to that commit? I tried </p>
  
  <pre><code>$ reset --hard 3425661dba2aadccdbab
  </code></pre>
  
  <p>but that only resetted my working head to that branch and requires me to do a <code>git pull</code> again. I tried checkout, but this caused me to land in a "detached head" branch.</p>