GitHub: How to create pull request from forked repository to upstream repo only including some past commits
<p>I forked a template repository (T) on GitHub and did some work in my own repo (X) making use of the template.</p>

<p>Now repo X completely conflicts with repo T because of custom work I pushed to X. </p>

<p>Other than doing custom work with the template, I also did some improvements to the template.</p>

<p>I created a pull request but it contains all my past commits since forking. I want to include only template improvements (just a few commits in the middle of my commit history) in the pull request. How can I achieve this?</p>