Haram bin Muhayyisah (may Allah have mercy on him) narrates from his father, Sayyiduna Sa'd bin Muhayyisah (may Allah be pleased with him), that a she-camel of Sayyiduna al-Bara' bin Azib (may Allah be pleased with him) entered a man's garden and damaged it. So the Messenger of Allah (peace and blessings be upon him) ruled that guarding (crops) by day is the responsibility of the owners of the land, and guarding the animals by night is the responsibility of the owners of the animals.
Hadith Referenceالمعجم الكبير للطبراني / باب السين / 5450