title: How to revert last commits on branch, merge with other branch and re-add the commits?
body: <p>I have the following problem. A git repo was forked a while ago. Starting from this fork, changes were made, but at the same time the original repo was also modified a lot more even, somehow like this:</p>
  
  <pre><code>A-B-C-D-E master
     \[fork]
      C'-D'-E'-F'-G'-H'-I'-J'----X' remote/master
  </code></pre>
  
  <p>It is important to note that the fork basically decoupled master and remote/master. The problem now is, I can create a local branch from remote/master and merge it directly with the local master branch. However, this will bring up a lot of merge conflicts which I would like to avoid, because most of these conflicts are related to changes in the main software package before B. So what I eventually would need to do is to take the last few commits of master since the fork and put them on top of the remote/master branch. Is that possible?</p>