Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bukhari:3008ʿAbdullāh b. Muḥammad > Ibn ʿUyaynah > ʿAmr > Jābir b. ʿAbdullāh

When it was the day (of the battle) of Badr, prisoners of war were brought including Al-Abbas who was undressed. The Prophet ﷺ looked for a shirt for him. It was found that the shirt of ʿAbdullah bin Ubai would do, so the Prophet ﷺ let him wear it. That was the reason why the Prophet ﷺ took off and gave his own shirt to ʿAbdullah. (The narrator adds, "He had done the Prophet ﷺ some favor for which the Prophet liked to reward him.")  

البخاري:٣٠٠٨حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُحَمَّدٍ حَدَّثَنَا ابْنُ عُيَيْنَةَ عَنْ عَمْرٍو سَمِعَ جَابِرَ بْنَ عَبْدِ اللَّهِ ؓ قَالَ

لَمَّا كَانَ يَوْمَ بَدْرٍ أُتِيَ بِأُسَارَى وَأُتِيَ بِالْعَبَّاسِ وَلَمْ يَكُنْ عَلَيْهِ ثَوْبٌ فَنَظَرَ النَّبِيُّ ﷺ لَهُ قَمِيصًا فَوَجَدُوا قَمِيصَ عَبْدِ اللَّهِ بْنِ أُبَىٍّ يَقْدُرُ عَلَيْهِ فَكَسَاهُ النَّبِيُّ ﷺ إِيَّاهُ فَلِذَلِكَ نَزَعَ النَّبِيُّ ﷺ قَمِيصَهُ الَّذِي أَلْبَسَهُ قَالَ ابْنُ عُيَيْنَةَ كَانَتْ لَهُ عِنْدَ النَّبِيِّ ﷺ يَدٌ فَأَحَبَّ أَنْ يُكَافِئَهُ