I have successively done this but it is NOT easy at all!
I get in between the companion and the attacker and take out and then put away my weapon, this is the action trigger to tell the attackers that you are yielding, doing this repeatedly with the proper amount of pausing in between pulling the weapon out and putting it way will stop the companion eventually in many case. I just have not figured out the proper "rhythm" to this to insure it works every time before someone dies.
The worst time this happen to me was with an extremely powerful friendly charter with a breath fire weapon that erroneously hit Lydia as he was demonstrating his power for me at a non living target. But Lydia was a little too close and got hit by the fire, so she attacked him.
Took me a dozen or so times of taking my weapon out and putting in back before they stop fighting each other!
I'd like to know too. I'm tired of my followers cutting down yielding bandits. I mean, we're not savages!