Jabir bin Abdullah reported,

On the day of Badr, the captives were brought in, and Abbas was among them. He had no garment on him, so the Prophet ﷺ looked for a shirt for him. They found that the shirt of Abdullah bin Ubayy was the right size for him, and the Prophet ﷺ clothed him in it. For this reason, the Prophet ﷺ later took off his own shirt and dressed Abdullah bin Ubayy in it.Ibn Uyayna said, "Abdullah bin Ubayy had once done the Prophet ﷺ a favor, so he wished to repay him for it."

Bukhari 3008

Sahih

حدثنا عبد الله بن محمد حدثنا ابن عيينة عن عمرو سمع

جابر بن عبد الله رضي الله عنهما قال

لما كان يوم بدر أتي بأسارى وأتي بالعباس ولم يكن عليه ثوب فنظر النبي ﷺ له قميصا فوجدوا قميص عبد الله بن أبي يقدر عليه فكساه النبي ﷺ إياه فلذلك نزع النبي ﷺ قميصه الذي ألبسه قال ابن عيينة كانت له عند النبي ﷺ يد فأحب أن يكافئه

البخاري 3008صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Jihad and expeditions
Chapter
Clothing for captives
Numbering
Darussalam 3008
Bukhari 3008