Sayyiduna Abdullah (may Allah be pleased with him) says: When the people of Ta'if were besieged and nothing was achieved as a result, the Messenger of Allah (peace and blessings be upon him) said: "We will return tomorrow, if Allah wills." The Muslims said: How can we go back when we have not succeeded? So the Messenger of Allah (peace and blessings be upon him) said: "Be ready for battle in the morning." In the morning they attacked them and were wounded. Then the Messenger of Allah (peace and blessings be upon him) said: "We will return tomorrow." The people liked that, and the Messenger of Allah (peace and blessings be upon him) smiled.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 17914