Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) says that Allah Almighty said: "O you who believe, take your precautions, then go forth in detachments" [Surah al-Nisa: 71]. Ibn Abbas (may Allah be pleased with them both) says: "thubat" means groups. "O you who believe!" "Or go forth all together" [Surah al-Nisa: 71]. And He said: "Go forth, light and heavy" [Surah al-Tawbah: 41]. And He said: "If you do not go forth, He will punish you with a painful punishment" [Surah al-Tawbah: 39]. Then He abrogated these verses and said: "It is not for the believers to go forth all together" [Surah al-Tawbah: 122]. And he said: One party would go out to the front with the Messenger of Allah (peace and blessings be upon him) and one party would stay behind. Those who stay with the Messenger of Allah (peace and blessings be upon him) are the ones who gain understanding of the religion, and they warn their people when they come back to them, so that they may beware regarding what Allah has revealed. This is in the matter of the obligations and the limits (hudud).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 17938