Sayyiduna Ya'la (may Allah be pleased with him), narrating this same incident, said that the Prophet (peace and blessings be upon him) ordered him to "take off the cloak", so he took it off over his head. [Sahih. But the detail about taking it off over the head is not authentic.]
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحج / 9102