كتاب الحج
15
The Book of Pilgrimage
(57)
Chapter: It is permissible to offer the sacrifice before stoning the Jamrah, or to shave before offering the sacrifice or stoning the Jamrah, or to perform Tawaf before any of them
(57)
باب مَنْ حَلَقَ قَبْلَ النَّحْرِ أَوْ نَحَرَ قَبْلَ الرَّمْىِ ‏‏
Sahih Muslim 1306 d

Abdullah b. Amr b. al-'As (Allah be pleased with them) reported:

As Allah's Apostle. (ﷺ) was delivering sermon on the Day of Nahr, a man stood up before him and said: Messenger of Allah, I did not know that such and such (rite was to be performed) before such and such (rite). Then another man came and said: Messenger of Allah, I thought that such and such (rite) should precede such and such (rite), and then another man came and said: Messenger of Allah, I had thought that such and such was before such and such, and such and such (is the sequence) of the three (rites, viz. throwing of pebbles, sacrificing of animal and shaving of one's head). He said to all these three: Do now (if you have not observed the cequence) ; there is no harm in it.
وَحَدَّثَنَا عَلِيُّ بْنُ خَشْرَمٍ، أَخْبَرَنَا عِيسَى، عَنِ ابْنِ جُرَيْجٍ، قَالَ سَمِعْتُ ابْنَ شِهَابٍ، يَقُولُ حَدَّثَنِي عِيسَى بْنُ طَلْحَةَ، حَدَّثَنِي عَبْدُ اللَّهِ بْنُ عَمْرِو بْنِ الْعَاصِ، أَنَّ النَّبِيَّ صلى الله عليه وسلم بَيْنَا هُوَ يَخْطُبُ يَوْمَ النَّحْرِ فَقَامَ إِلَيْهِ رَجُلٌ فَقَالَ مَا كُنْتُ أَحْسِبُ يَا رَسُولَ اللَّهِ أَنَّ كَذَا وَكَذَا قَبْلَ كَذَا وَكَذَا ثُمَّ جَاءَ آخَرُ فَقَالَ يَا رَسُولَ اللَّهِ كُنْتُ أَحْسِبُ أَنَّ كَذَا قَبْلَ كَذَا وَكَذَا لِهَؤُلاَءِ الثَّلاَثِ قَالَ ‏ "‏ افْعَلْ وَلاَ حَرَجَ ‏"‏ ‏.‏
Reference : Sahih Muslim 1306 d
In-book reference : Book 15, Hadith 363
USC-MSA web (English) reference : Book 7, Hadith 2998
  (deprecated numbering scheme)