Exodus 13:17-18 ESV
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.” 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.
ESV: English Standard Version 2016