I experienced a similar bug once in Civ 5 (over something like 100 games), and I believe when it happens you have no choice but to delete the unit.
While I believe this is a bug, and that it should be fixed by revealing the unit blocking your movement without moving your unit, you can play around it if you're willing to take some time to think through whether it can occur for a particular move.
In my case, I'd moved a ship exploring a congested area to a spot in the fog that looked free. When I came close to that spot, it turned out one of the AIs had filled the entire area - three tiles in every direction - with ships. Since the game took my movement points and left me in a spot with no free tiles within my remaining movement, I had no choice but to disband the unit to continue.
It's fairly rare that it happens, because the engine will stop a unit's movement as soon as that unit sees that the tile you were targeting is occupied, your unit must have enough movement (and poor enough vision/line-of-sight) that by the time they can see the tile is occupied, they have moved deep enough into a crowd that there is no open tile within their remaining movement.
If you suspect that the AI may have filled every tile with units and there's a chance of being forced to delete your unit if you command it into the fog, you can avoid it by not commanding moves into the fog, move only to open tiles that you can see have no unit in them, unless you consider it worth the risk for the exploration benefit.
Do remember, though, that you don't have to avoid moving into fog unless your unit won't see the tile is occupied in time to back up. For example, if your unit has three movement, and can see the tile it is moving to after it takes the first move (considering line-of-sight rules like hills and forests), then you can safely make that move, knowing you'll be able to back up to your original tile if it turns out that you can't move forward...but suppose the second tile you're moving through is forest, then your unit won't see the tile they're moving to until they make two moves, at which point they can't back up anymore.
Most units can't get into a situation where they'd have to be deleted, except in special circumstances involving roads: they simply don't have enough movement to go further than they can see and get into trouble...but since a horse archer has four movement, you can attempt to make a move similar to the one I just described: starting tile -> flat ground with unit (3 left) -> forested ground with unit (1 left) -> flat ground with unit in fog, and get in trouble when you're stopped with one movement remaining on the forest, if all adjacent one-movement-cost tiles are occupied.