The WM Compendium ruleset (Retreats, page 45, column 2, paragraph 2) clearly states;
"If all of a unit is supporting another, eg. if it is placed in a second line, then none of its stands are touching an enemy. In this case, the friendly supported unit/s determine the direction of retreat. Work out the direction of retreat for the fighting units and then move supporting units back in the same direction. This means fighting and supporting units will effectively move as one, although it will still be necessary to move the units one at a time to make sure that stands have a path to their final position."
I would use this as a guide to working out the direction of retreat for a unit that is no longer in contact with any enemy. So in your example the Retreat would follow the direction of any friendly units in the same combat, or the direction they would have had to retreat in should there be no friendly units left! .