title: How to undo git commits locally and on remote without losing changes
body: <p>We have a project in remote repository. Recently I created a new branch "Feature7" and made huge changes and committed twice and also pushed twice. Fortunately, no one pulled from that branch. After that there have been lots of commit and push in master branch but no one worked on Feature7 branch. </p>
  
  <p>Now I want to undo the two commits and push, both from local and remote if possible of the Feature7 branch. But I want the changes to keep locally as well. I don't want to loose my changes. </p>
  
  <p>So in short, I only want to undo both commits and push without losing my changes in local. </p>
  
  <p>The reason I am doing this because, in the new branch there is a problem for line endings of whole project. So I messed up the history of the whole project. It is not possible to recognize what changes I made in my new branch.  </p>