Exodus 13:17 - 18
ESV - 17 When Pharaoh let the people go, God did not lead them by way of the land of the Philistines, although that was near. For God said, "Lest the people change their minds when they see war and return to Egypt. 18 But God led the people around by the way of the wilderness toward the Red Sea. And the people of Israel went up out of the land of Egypt equipped for battle.
For follow-up discussion and general commentary on the topic. Comments are sorted chronologically.