It was narrated from Abdullah bin Safwan that :
his father slept in the mosque, using his upper wrap as a pillow, and it was taken from beneath his head. He brought the thief to the Prophet (ﷺ) and the Prophet (ﷺ) ordered that his hand be cut off. Safwan said: "O Messenger of Allah , (ﷺ) I did not want this! I give my upper wrap to him in charity." The Messenger of Allah (ﷺ) said: "Why did you not give it to him before you brought him to me?" (TR)
English reference (TR): Vol. 3, Book 20, Hadith 2595 (TR)
Arabic reference (TR): Book 20, Hadith 2693 (TR)