Jabir (May Allah be pleased with him) reported: Messenger of Allah (ﷺ) said, “When a Muslim plants a tree, whatever is eaten from it is charity from him and whatever is stolen is charity and whatever is subtracted from it is charity.”
Another narration says: “If a Muslim plants a tree, or sows a field and men and beasts and birds eat from it, all of it is charity from him.”
Commentary: This Hadith highlights the importance of gardening and agriculture. It is also one of the merits of these two occupations that if someone patiently bears the loss that he suffers due to pilferage or theft of their produce, he is rewarded for it.
[Riyad us-Saliheen, Book of Miscellany, Chapter 13, No. 135]