title: How to remove previous commits and keep the ones that are my changes?
body: <p>I have a single branch (called <code>my-working-branch</code>) that I worked on that have several commits of my changes. When I committed and push my changes to <code>master</code>, thus created a pull request for the reviewer to merge, inside the pull request I saw my commits which I want to keep and merge to <code>master</code> along with so many other previously committed changes before mine that I've never changed and was committed by a different author. I am using Bitbucket and so some commits are greyed out with an "M" assuming meaning that commit was merged in master already and some without an "M" and isn't greyed out assuming not merged like my commits from <code>my-working-branch</code>. </p>
  
  <p>Now that you understand my situation, what I want to do is keep the first four recent commits that I have in the pull request and remove all of the other commits within <code>my-working-branch</code> (no one else worked on this branch and made changes to it except me) that seems to be added in a previous date that shows within my pull request I created. I've looked at other stackoverflow questions regarding using the <code>rebase</code> command but since from what I understand it's a destructive command and would rewrite history. I would be fine using it if this only affects my local branch and the pull request to reflect that but I wanted to be absolutely sure this is the right direction to go in as in squashing all those previous commits and keep only the first recent four commits that I have changed which should keep changes to just those four commits and the rest not shown in the pull request to then merge to master.</p>
  
  <p>What would be the appropriate action in this situation?</p>
  
  <p>For example: (<code>d74981d0dcd..041727236cb</code> first four commits to keep and the rest after that I want to remove from the pull request)</p>
  
  <p><a href="https://i.stack.imgur.com/OCcWL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OCcWL.png" alt="enter image description here"></a></p>