Abdullah bin Amr reported that the Messenger of Allah ﷺ stood at Mina during the Farewell Pilgrimage while people were questioning him. A man came to him and said, "Messenger of Allah, I did not realize, so I shaved before slaughtering."The Messenger of Allah ﷺ replied, "Slaughter, and there is no harm."Another man came and said, "Messenger of Allah, I did not realize, so I slaughtered before stoning."He said, "Stone, and there is no harm."He said that on that day, the Prophet ﷺ was not asked about anything done out of order, whether earlier or later, except that he said, "Do it, and there is no harm."
حدثنا القعنبي عن مالك عن ابن شهاب عن عيسى بن طلحة بن عبيد الله
أنه قال وقف رسول الله ﷺ في حجة الوداع بمنى يسألونه فجاءه رجل فقال يا رسول الله إني لم أشعر فحلقت قبل أن أذبح فقال رسول الله ﷺ اذبح ولا حرج وجاء رجل آخر فقال يا رسول الله لم أشعر فنحرت قبل أن أرمي قال ارم ولا حرج قال فما سئل يومئذ عن شيء قدم أو أخر إلا قال اصنع ولا حرج
Bukhari, Knowledge, chapter "Issuing a Legal Ruling While Standing on a Riding Animal or Otherwise", no. 83, etc., and Muslim, Hajj, chapter "The Permissibility of Slaughtering Before Stoning, and Shaving Before Slaughtering and Stoning", no. 1306, from the hadith of Malik through this chain, and it is in the Muwatta (Yahya), 1/421.