The Messenger of Allah ﷺ and his companions entered the state of ihram for Hajj, and on that day none of them had brought a sacrificial animal except the Prophet ﷺ and Talha. Ali had arrived from Yemen with a sacrificial animal, and he said, "I have entered ihram for the same as the Messenger of Allah ﷺ entered ihram for."The Prophet ﷺ commanded his companions to convert their intention into Umrah, to perform tawaf, then shorten their hair and exit ihram, except for those who had brought sacrificial animals.They said, "Are we to set out for Mina with our private parts dripping?"When this reached the Messenger of Allah ﷺ, he said, "Had I known beforehand what I have come to know now, I would not have brought the sacrificial animal, and were it not that I have the sacrificial animal with me, I would have exited ihram."
حدثنا أحمد بن حنبل حدثنا عبد الوهاب الثقفي حدثنا حبيب يعني المعلم عن عطاء
أن رسول الله ﷺ أهل هو وأصحابه بالحج وليس مع أحد منهم يومئذ هدي إلا النبي ﷺ وطلحة وكان علي رضي الله عنه قدم من اليمن ومعه الهدي فقال أهللت بما أهل به رسول الله ﷺ وإن النبي ﷺ أمر أصحابه أن يجعلوها عمرة يطوفوا ثم يقصروا ويحلوا إلا من كان معه الهدي فقالوا أننطلق إلى منى وذكورنا تقطر فبلغ ذلك رسول الله ﷺ فقال لو أني استقبلت من أمري ما استدبرت ما أهديت ولولا أن معي الهدي لأحللت
Bukhari related it in Hajj, chapter "The Menstruating Woman Performs All the Rites of Hajj Except tawaf of the House," etc., hadith 1651, from the hadith of Abdul-Wahhab Thaqafi through this route, and it is also found in Musnad Ahmad, 3/305.