Deuteronomy 30:3
That then the LORD thy God will turn thy captivity, and have compassion upon thee, and will return and gather thee from all the nations, whither the LORD thy God hath scattered thee. That then the LORD thy God will turn thy captivity, and have compassion upon thee, and will return and gather thee from all the nations, whither the LORD thy God hath scattered thee.
The promise looks beyond Israel's settlement in Canaan, when each tribe was established in its own possession, to a long subsequent history in which apostasy would bring punishment. The scattering among the nations followed Israel's failure to carry God's truth to other peoples and to serve as missionaries to the world. Because of their sins they would be dispersed among the heathen, the glory would depart from Israel, their beautiful city would lie in ruins, and the people would become captives in strange lands. Yet even that scattering carried knowledge of God's truth to the world.
The promised restoration is conditional on repentance and return to God in penitence and faith, on keeping His commandments, and on being loyal, true, and submissive to Him. When they so return, He will have compassion on them, end their captivity, restore His favor to them, and gather them from all the nations where He scattered them back to their own land and to the land of their fathers.
The scattering itself showed God faithful to His warnings, and the promise of gathering assures He is equally faithful to His promises. Though given more than a thousand years earlier, the promise remained unchanged, and it gave Nehemiah confidence to pray for his people's restoration and for strength in the work. After being restored to their land, Israel would at last be brought under the dominion of Rome.