title: Git branch filter selected files
body: <p>I have some commits of a branch and want create to another branch but for only certain files.</p>
  
  <p>Let's</p>
  
  <p><code>git checkout mybranch</code></p>
  
  <p>switching from <strong>master</strong> to <strong>mybranch</strong> and there already exist some commits which apply changes to different files.</p>
  
  <p>Now I want to create a branch where I see similar commits but this time only with changes for files I selected. How could I do that?</p>
  
  <p>My idea would be taking every commit and create a second commit for each one, where the selected files changes appear. But that can lead to a lot of manual work depending how many commits you have. Also I doubt those can be easily merged later on.</p>
  
  <p>What is the best way to merge only changes of selected files? Is it even possible?</p>