Exodus 13:17

It happened, when Pharaoh had let the people go, that God didn’t lead them by the way of the land of the Philistines, although that was near; for God said, “Lest perhaps the people change their minds when they see war, and they return to Egypt;”