He donated a horse for the cause of Allah, then later saw it being sold and wanted to buy it. The Prophet ﷺ said, "Do not take back what you have given in charity."
حدثنا هارون بن إسحق الهمداني حدثنا عبد الرزاق عن معمر عن الزهري عن سالم عن ابن عمر
أنه حمل على فرس في سبيل الله ثم رآها تباع فأراد أن يشتريها فقال النبي ﷺ لا تعد في صدقتك
Agreed upon by Bukhari and Muslim. Muslim narrated it in the Book of Gifts, chapter on the dislike of a person buying back what he gave in charity, etc., hadith no. 1621, from the hadith of Abdul-Razzaq. Bukhari narrated it in the Book of Zakat, chapter on whether one may buy back his charity, etc., hadith no. 1489, from the hadith of Zuhri, with the same wording.