When the Kaabah was being built, the Prophet ﷺ and Abbas were carrying stones. Abbas said to the Prophet ﷺ, "Place your lower garment over your shoulder to protect you from the stones."He fell to the ground, his eyes gazing toward the sky. Then he came to and said, "My garment."So his garment was tied back around him.
لما بنيت الكعبة ذهب النبي ﷺ وعباس ينقلان الحجارة. فقال عباس للنبي ﷺ اجعل إزارك على رقبتك يقيك من الحجارة. فخر إلى الأرض، وطمحت عيناه إلى السماء، ثم أفاق فقال: إزاري. فشد عليه إزاره.
Bukhari related it in the Book of Virtues (3829) and Muslim in the Book of Menstruation (340), both from the hadith of Abdul-Razzaq, who said, Ibn Jurayj told us, Amr bin Dinar told me that he heard Jabir bin Abdullah say, and he mentioned it. In another version reported by both of them, "He was never seen naked after that."