Played yesterday on Vassal and got the following situation:
My cavalry was standing near infantry in square, while other enemy infantry was deployed on 2 hex distance from cavalry.
My opponent played "Fire and Hold" card and ordered both infantry units. At first unit "not in sq" fired and made my cavalry to retreat (2 flags). Than he took square marker off from his unit and announced ranged combat.
As I understand rules, it is not possible - coming out of square is reform and it may be done only before battle phase. So even when cavalry which "holds" unit in square retreats or eliminates during battle, infantry must wait till next turn to "free" itself.
But my opponent told me "where can I read this?" and I wouldnt able to find direct instruction in rulebook.