title: How to undo the last commit in git
body: <p>By mistake, I did <code>git add .</code> and <code>git commit</code> in the <code>develop</code> branch. But luckily, I did not do <code>git push</code>.</p>
  
  <p>So I wanted to revert it back to original state.</p>
  
  <p>I tried <code>git reset --soft</code> and <code>git reset HEAD --hard</code> but looks like I have messed it up.</p>
  
  <p>How do I fix this? I want to go back to original state and possibly keep the code changes.</p>