title: Modifying committed patch in git
body: <p>I applied a patch to my repo which accidentally contained trailing spaces.  When I do a "git rebase master", git complains about the trailing spaces.  How can I fix the patch to eliminate the trailing spaces?</p>
  
  <p>I thought to reset the top of the branch to the patch which needs to be modified, fix the trailing spaces, then reapply the patch:</p>
  
  <pre><code>$ git reset --hard &lt;commit-id&gt;
  &lt; edit files&gt;
  $ git commit --amend
  </code></pre>
  
  <p>Is there a better way to do this?</p>
  
  <p>How to I get the branch back to its previous state, with subsequent patches applied?  </p>