If your unit loses the combat, but does not flee, it can still attempt a combat reform.
In this case, your unit must pass a Leadership test to muster the necessary discipline to alter its formation. Note that this Leadership test is subject to any modifiers from having lost the fight, just like a Break test. If your unit is steadfast the test is taken on the unit's unmodified Leadership. If the test is failed, your unit cannot make a combat reform. If the test is passed, the combat reform can be carried out as described above.