The Book of Gifts
Ṣaḥīḥ Muslim 4165
لاَ تَشْتَرِهِ وَإِنْ أُعْطِيتَهُ بِدِرْهَمٍ فَإِنَّ مَثَلَ الْعَائِدِ فِي صَدَقَتِهِ كَمَثَلِ الْكَلْبِ يَعُودُ فِي قَيْئِهِ
lā tashtarihi wa-in uʿṭītah bidirhamin fa-inna mathala al-ʿāʾidi fī ṣadaqatihi kamathali al-kalbi yaʿūdu fī qayʾihi
Transliteration generated from the Arabic vowel marks
The full narration
Zaid b. Aslam reported on the authority of his father that 'Umar (Allah be pleased with him) donated a horse in the path of Allah. He found that it had languished in the hand of its possessor, and he was a man of meagre resources He (Hadrat 'Umar) intended to buy it. He came to Allah's Messenger (ﷺ) and made a mention of that to him, whereupon he said:Don't buy that even if you get it for a dirham for he who gets back the charity is like a dog which swallows its vomit
Source
Ṣaḥīḥ Muslim · 4165