Exodus
13:17
When Pharaoh had let the people go, God did not let them take the road
to the Philistines' territory, although that was the shortest, 'in case',
God thought, 'the prospect of fighting makes the people change their
minds and turn back to Egypt.'