Whether ye cut down (O ye Muslim!) The tender palm-trees, or ye left them standing on their roots, it was by leave of Allah, and in order that He might cover with shame the rebellious transgresses. Al-Hashr 59:5 ⧉
Tafsir:
Those who opposed the Prophet were destined to suffer such punishment. During the siege of the Banu al-Nadir, some trees in their gardens were cut down as a matter of military strategy. This was done on the direct orders of the government. However, this was not the general rule. This was an exceptional case concerning the immediate addressees of the Prophet.