كتاب الحج
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 f

Adullah b. 'Amr (b. al-'As) (Allah be pleased with him) reported that a person came to Allah's Apostle (ﷺ) and said:

I got (my head) shaved before sacrificing the, animal, whereupon be (the Holy Prophet) said: Sacrifice the animal (now) ; there is no harm in it. He (the person said): I sacripced the animal before throwingpebbles. whereupon he said: Throw pebbles (now) ; there is no harm in it.
وَحَدَّثَنَاهُ أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَزُهَيْرُ بْنُ حَرْبٍ، قَالَ أَبُو بَكْرٍ حَدَّثَنَا ابْنُ عُيَيْنَةَ، عَنِ الزُّهْرِيِّ، عَنْ عِيسَى بْنِ طَلْحَةَ، عَنْ عَبْدِ اللَّهِ بْنِ عَمْرٍو، قَالَ أَتَى النَّبِيَّ صلى الله عليه وسلم رَجُلٌ فَقَالَ حَلَقْتُ قَبْلَ أَنْ أَذْبَحَ ‏.‏ قَالَ ‏"‏ فَاذْبَحْ وَلاَ حَرَجَ ‏"‏ ‏.‏ قَالَ ذَبَحْتُ قَبْلَ أَنْ أَرْمِيَ ‏.‏ قَالَ ‏"‏ ارْمِ وَلاَ حَرَجَ ‏"‏ ‏.‏
Reference : Sahih Muslim 1306f
In-book reference : Book 15, Hadith 365
USC-MSA web (English) reference : Book 7, Hadith 3000
  (deprecated numbering scheme)