I've found that retreating with infantry units is very possible without suffering heavy casualties as long as another unit is still engaging the enemy.

A few enemies will try and follow your disengaging unit, but being in "combat mode" they will move very slowly whereas your troops are running full-tilt. You can stop and kill these handful pursuers at leisure if you want, though this may take some time, or just ignore them and charge in again, though this will make your charge a bit ragged as some of your troops will stop to engage the handful pursuers.

Still, this way you can pin down the enemy with a cheap unit in guard-mode and deliver multiple rear-charges with a harder-hitting unit. I imagine it's bad for enemy morale too. I've noticed units that were stubbornly holding ground break when my troops withdrew and charged back in. (Camillan Hastati/Principes against Solduros = long, long grind even if you surround them with four times their numbers. Much better to rout them.)