Generally in old warfare, if being stabbed in the back was a threat, things had already gone sideways. Battles were fought in formations designed such that each man helped cover the flanks of those next to him. You don't really get anything like the scenes from movies where battles are essentially a massive amount of one-on-one battles.
The advice in military manuals at the time tended to be along the lines of "If your formation isn't organized properly, it will be breached and that is very bad", exactly because of the danger of being blindsided by people you can't see.
You would think that in the swirling melee of one-on-one sword battles of old, with all those pirouettes, lunging and parring, what stops the enemy to your left from taking a step back, turning to the left and stabbing you in the ear as you chase your nemesis through the conveniently spaced people fighting?
The answer is nothing would stop them: nothing's easier to kill than an isolated soldier. That's why after the bronze age soldiers fought in compact formations. Discipline and morale are far more important factors than actual fighting skills, because battles weren't melees as much as they were masses of people showing each other. Similarly, mounted knights also charged knee-to-knee to maximize impact. It was important that they stay knee-to-knee through the charge, as an isolated knight could be very easily pulled off his horse (pikes pole-arms, like the ones pictures here, often had hooks and spikes on one side for this express purpose).