Language:
كتاب المحصر
27  
Pilgrims Prevented from Completing the Pilgrimage
(3)
Chapter: The slaughtering before shaving the head (in case) one is prevented
(3)
باب النَّحْرِ قَبْلَ الْحَلْقِ فِي الْحَصْرِ
Sahih al-Bukhari 1812

Narrated Nafi`:

That `Abdullah and Salim said to `Abdullah bin `Umar, "(You should not go for Hajj this year)." `Abdullah bin `Umar replied, "We set out with the Prophet (to Mecca for performing `Umra) and the infidels of Quraish prevented us from reaching the Ka`ba. Allah's Messenger (ﷺ) slaughtered his Budn (camels for sacrifice) and got his head shaved."

حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ الرَّحِيمِ، أَخْبَرَنَا أَبُو بَدْرٍ، شُجَاعُ بْنُ الْوَلِيدِ عَنْ عُمَرَ بْنِ مُحَمَّدٍ الْعُمَرِيِّ، قَالَ وَحَدَّثَ نَافِعٌ، أَنَّ عَبْدَ اللَّهِ، وَسَالِمًا، كَلَّمَا عَبْدَ اللَّهِ بْنَ عُمَرَ ـ رضى الله عنهما ـ فَقَالَ خَرَجْنَا مَعَ النَّبِيِّ صلى الله عليه وسلم مُعْتَمِرِينَ، فَحَالَ كُفَّارُ قُرَيْشٍ دُونَ الْبَيْتِ، فَنَحَرَ رَسُولُ اللَّهِ صلى الله عليه وسلم بُدْنَهُ، وَحَلَقَ رَأْسَهُ‏.‏
Reference : Sahih al-Bukhari 1812
In-book reference : Book 27, Hadith 7
USC-MSA web (English) reference : Vol. 3, Book 28, Hadith 39
  (deprecated numbering scheme)