and Allah said "And proclaim the pilgramage among men; they will come to thee on foot and on every kind of camel. Lean on account of Journeys through deep and distant mountain highways" Surah 22 ~ Al Hajj Part 27
At Mount Uhud the Muslim troops passed the night, and in the morning, after offering their prayers, they advanced into the plain. The Prophet contrived to have the hill at his back, and, the better to secure his men from being surrounded; he placed fifty archers on the height in the rear, behind the troops, and gave them strict orders not to leave their posts whatever might happen. When they came to engage, the Prophet had superiority at first. But afterward, his archers left their position for the sake of plunder, thus allowing the enemy to attack the Muslims in the fear and surround them. The Prophet lost the day and very nearly lost his life. He was struck down by a shower of stones and wounded in the face by two arrows, and one of his front teeth was broken. Seventy Muslim warriors were killed, among whom was the Prophet's Uncle Hamza. Of the infidels, twenty-two men were lost.
The Quraish were too exhausted to follow up their advantage, either by attacking Medina or by driving the Muslims from the heights of Uhud. They retreated from the Medinite territories after barbarously mutilating the corpses of their dead enemies.
Almighty Allah said: So do not become weak (against your enemy), nor be sad, and you will be superior (in victory) if you are indeed (true) believers. If a wound (and killing) has touched you, be sure a similar wound (and killing) has touched the others. And so are the days (good and not so good), we give to men by turns, that Allah may test those who believe, and that He may take martyrs from among you. And Allah likes not the Zalimeen (polytheists and wrongdoers). And that Allah may test (or purify) the believers (from sins) and destroy the disbelivers. Do you think that you will enter Paradise before Allah tests those of you who fought (in His Cause) and (also) tests those who are patient? You did indeed wish for death (Ash-shahadah- martyrdom) before you met it. Now you have seen it openly with your own eyes." ( 3:139-143 Quran)
Allah the Exalted also said: "We shall cast terror into the hearts of those who disbelieve, because they joined others in worship with Allah for which He has sent no authority; their abode will be the Fire and how evil is the abode of the Zalimeen (polytheists and wrong-doers). And Allah did indeed fulfil His Promise to you when you were killing them (your enemy) with His Permission; until (the moment) you lost your courage and fell to disputing about the order, and disobeyed after He showed you (of the booty) which you love. Among you are some that desire this world and some that desire the Hereafter. Then He made you flee from them (your enemy), and He might test you. But surely, He forgave you, and Allah is most gracious to the believers and remember when you ran away (dreadfully) without even a casting a side-glance at anyone, and the Messenger (Muhammad) was in your rear calling you back. There did Allah give you one distress after another by way of requital to teach you not to grieve for that which had escaped you, nor that which had befallen you. And Allah is Well Aware of all that you do. Then after the distress, He sent down security for you. Slumber overtook a party of you, while another party was thinking about themselves (as how to save their own selves, ignoring the others and the Prophet) and thought wrongly of Allah - the thought of ignorance. They said, "Have we any part in the affair?" Say you (O Muhammad): "Indeed the affair belongs wholly to Allah." They hide within themselves what they dare not reveal to you, saying: "If we had anything to do with the affair, none of us would have been killed here." Say: "Even if you had remained in your homes, those for whom death was decreed would certainly have gone forth to the place of their death," but that Allah might test what is in your breasts; and to Mahis (to test, to purify, to get rid of) that which was in your hearts (sins), and Allah is All Knower of what is in (your) breasts." ( 3:151-154 Quran).