Messenger of Allah ﷺ stopped while riding his camel and the people began to ask him. One of the inquirers said: Messenger of Allah, I did not know that pebbles should be thrown before sacrificing the animal, and by mistake I sacrificed the animal before throwing pebbles, whereupon Messenger of Allah ﷺ said: (Now) throw pebbles and there is no harm in it. Then another (person) came saying: I did not know that the animal was to be sacrificed before shaving, but I got myself shaved before sacrificing the animal, whereupon he (the Holy Prophet) said: Sacrifice the animal (now) and there is no harm in it. He (the narrator) said: I did not hear that anything was asked on that day (shout a matter) which a person forgot and could not observe the sequence or anything like it either due to forgetfulness or ignorance, but Messenger of Allah ﷺ said (about that): Do it; there is no harm in it.
أَنَّهُ سَمِعَ عَبْدَ اللَّهِ بْنَ عَمْرِو بْنِ الْعَاصِ يَقُولُ وَقَفَ رَسُولُ اللَّهِ ﷺ عَلَى رَاحِلَتِهِ فَطَفِقَ نَاسٌ يَسْأَلُونَهُ فَيَقُولُ الْقَائِلُ مِنْهُمْ يَا رَسُولَ اللَّهِ إِنِّي لَمْ أَكُنْ أَشْعُرُ أَنَّ الرَّمْىَ قَبْلَ النَّحْرِ فَنَحَرْتُ قَبْلَ الرَّمْىِ فَقَالَ رَسُولُ اللَّهِ ﷺ فَارْمِ وَلاَ حَرَجَ قَالَ وَطَفِقَ آخَرُ يَقُولُ إِنِّي لَمْ أَشْعُرْ أَنَّ النَّحْرَ قَبْلَ الْحَلْقِ فَحَلَقْتُ قَبْلَ أَنْ أَنْحَرَ فَيَقُولُ انْحَرْ وَلاَ حَرَجَ قَالَ فَمَا سَمِعْتُهُ يُسْأَلُ يَوْمَئِذٍ عَنْ أَمْرٍ مِمَّا يَنْسَى الْمَرْءُ وَيَجْهَلُ مِنْ تَقْدِيمِ بَعْضِ الأُمُورِ قَبْلَ بَعْضٍ وَأَشْبَاهِهَا إِلاَّ قَالَ رَسُولُ اللَّهِ ﷺ افْعَلُوا ذَلِكَ وَلاَ حَرَجَ