It is narrated from Sayyiduna Anas (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Any Muslim who plants a tree or sows a crop, and then birds, a human being or an animal eat from it, it becomes a charity (sadaqah) for him."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المزارعة / 11747