I have following problem:
I have some common commit A for two branches Branch1 and Branch2.
You can rename
BAD_folder, merge or rebase
Branch2 (which might be better when this branch is local) and rename folder back.
git checkout -b _tmp Branch1
git mv folder BAD_folder && git commit
git merge Branch2
git mv BAD_folder && git commit
When you did a rebase, you can do an additional
git rebase -i Branch1 and remove the two
git mv operations.
merge in point 3 works much better when filenames did not change but you might still have to resolve conflicts.