I am in branch B. After a bunch of commits, a few files are ready/needed by branch A, but many aren't ready/needed. I want to merge just those files, keeping proper git history. Later, when I really merge, I don't want any misleading trail about the origin of these changes -- they should properly reference the commits they came from, even though changes in other files that were part of those commits were not merged (yet). I guess that means dividing commits into pieces that do vs. don't concern these files.
All proposed solutions for this wind up losing the history of these changes and cause a big problem when I later want to merge B into A but some of B's changes are already there. I want a solution that avoids this.
In tortoise, I can look at the log for a single file and choose some older revision to revert to. So, in principle, I could make a new branch C, from B, and revert all the files I don't want to merge back to the point when B branched from A. Then I could merge C to A. That seems to properly track git history and lets me merge B into A without being surprised that some B changes are already there.
But it's painful to manually identify and revert 20 files, when I just want to merge 2. Why isn't this a common one-step operation? How does tortoise's revert work -- since it can operate on a single file, it must be sub-commit, which is the essential feature I'm looking for. Is it throwing away the fact that I am going from a newer revision to an older one, and making it look like I just made some manual changes that will then conflict with the eventual merge of B back to A?