Urwah bin al-Zubayr said: The Messenger of Allah (peace and blessings be upon him) camped on a hillock near the fortress of Ta'if. He (peace and blessings be upon him) besieged them for more than ten nights, and Banu Thaqif fought with arrows and stones while they were inside the fortress of Ta'if. Many men of the Muslims and of Banu Thaqif were killed, and the Muslims cut down some of Banu Thaqif's grapevines to enrage them. Urwah said: The Messenger of Allah (peace and blessings be upon him) had commanded the Muslims: "Let each man cut down five date palms or five grapevines." Umar (may Allah be pleased with him) said: O Messenger of Allah! These are abundant; their fruit has not been eaten. Then he (peace and blessings be upon him) ordered: "Cut down the trees whose fruit has been eaten; cut those first."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18117