Don't buy that and do not get back what you gave in charity.

Sahih Muslim Book 24 Hadith 5

Sahih Muslim #1621 a

The Book of Gifts 24:5

Ibn 'Umar reported that 'Umar b. al-Khattib (Allah be pleased with him) donated a horse in the path of Allah and (later on) he found it being sold, and he decided to buy that. He asked the Messenger of Allah (ﷺ) about it. whereupon he (the Holy prophet) said:

Don't buy that and do not get back what you gave in charity.

Chapter: It Is Disliked For A Man To Buy What He Gave In Charity From The One To Whom He Gave It

Grade: Sahih