This is how i would resolve it:
First find the last commit that both branches have in common, this is where the two branches start to diverge:
$ git merge-base branchA branchB
050dc022f3a65bdc78d97e2b1ac9b595a924c3f2
Then checkout a new branch from that commit:
git branch branchC 050dc022f3a65bdc78d97e2b1ac9b595a924c3f2
Then checkout the folder you want to merge from source branch into the new branch:
git checkout branchC
git checkout branchB ./path/to/the/folder/you/want/to/merge
git commit -m "update folder to merge from branchB"
Now branchC contains only changes from the folder you want to merge.
Finally merge those changes into target branch:
git checkout branchA
git merge branchC
Now you can handle any merge conflicts as you see fit.