A unit of troops can change the direction in which it is facing and rearrange its formation all at once by means of a manoeuvre called reforming. The leader issues the order to adopt a new formation, and the troops mill about until they assume their new positions.
A unit of troops can reform during its movement phase so long as it is not in hand-to-hand combat and is otherwise free to move as it wishes. The player declares the unit is reforming and it regroups into a new formation. Arrange the unit into a new formation of as many ranks as you please facing whichever direction you wish.
A unit which reforms cannot move that turn, because it takes the entire movement phase to reform. Reforming troops cannot shoot with missile weapons that turn, because they are too busy assuming their new formation.