It is narrated from Sayyiduna Sa'id bin Zayd (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever revives barren land, it belongs to him, and the root of a wrongdoer has no right."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الغصب / 11538
Yahya bin Urwah narrates from his father (Urwah) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever revives barren land, it belongs to him, and the root of a wrongdoer has no right." He said: Two men of the tribe of Bayadah brought a dispute to the Messenger of Allah (peace and blessings be upon him); one of them had planted date palms in the other's land. the Messenger of Allah (peace and blessings be upon him) ruled that the land belonged to the owner of the land, and ordered the owner of the palms to remove his palms. Urwah said: The one who narrated the hadith to me said: Their roots were being cut with axes, and they were sturdy, full-grown palms when they were taken out.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الغصب / 11539
A narration with the same meaning is reported from Muhammad bin Ishaq, with the addition that the narrator saw two men of the tribe of Bayadah disputing.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الغصب / 11540
It is like the previous hadith, except for these words: a man from the Companions of the Prophet (peace and blessings be upon him) said, and my strongest assumption is that he was Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him): I saw the man striking at the roots of the date palms.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الغصب / 11541