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".[Muslim].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".
Arabic/English book reference: Book 1, Hadith 135