The people suffered defeat at Ai because of the sin of one man. Now the Lord speaks to Joshua and assures him of victory. The sin of one man brought them death, but the presence of one (The LORD) will bring certain victory.
One revival or restoration is never enough for the people of God. God’s people follow the natural lines of spiritual degeneration. They will naturally slide backwards toward the ways of the world. They require periodic revivals in order to remain close to the Lord. When the revivals cease, the people will fall further and further away from the Lord.
The work of rebuilding the wall is not fully completed until the city is inhabited with a sufficient population and the wall is dedicated to the Lord. If you have done a work for the Lord, make sure that you finish the work by making sure that it set on a firm foundation and by dedicating it to the Lord and to His service.
A covenant is a solemn agreement. The most important covenants in the Bible are those in which God makes a covenant with man: the Abrahamic Covenant, the Davidic Covenant, etc. Here is a covenant which man makes with God. The Israelites recognize the importance of God and covenant together to wholly follow Him.
This is one of the great revivals in the Bible. As usual, it is a revival of the word of God. When God’s people return to the word and obey its teachings, they experience great joy and are greatly blessed by the Lord.