I was present at the Eid al-Adha with the Messenger of Allah ﷺ. He led the people in prayer, and when he had finished, he saw that some sheep had already been slaughtered. He said, "Whoever slaughtered before the prayer, let him slaughter another sheep in its place, and whoever has not yet slaughtered, let him slaughter in the name of Allah ."
أخبرنا هناد بن السري عن أبي الأحوص عن الأسود بن قيس
شهدت أضحى مع رسول الله ﷺ فصلى بالناس فلما قضى الصلاة رأى غنما قد ذبحت فقال من ذبح قبل الصلاة فليذبح شاة مكانها ومن لم يكن ذبح فليذبح على اسم الله عز وجل
Muslim narrated it, in the Sacrifices, chapter on its time, hadith no. 1960, from the hadith of Abu Ahwas, etc., and hadith no. 985, from the hadith of Aswad, and Bukhari narrated it, in the Two Eids, chapter on the imam and the people speaking during the sermon of Eid, with the same wording, and it is in Al-Kubra, hadith no. 4458.