Abdullah bin Umar reported,

Umar bin Khattab once gave a horse as a contribution in the cause of Allah. Later he found it being offered for sale and wanted to buy it back. He asked the Messenger of Allah ﷺ about it, and the Prophet said, "Do not buy it, and do not take back what you have given in charity."

Bukhari 3002

Sahih

حدثنا عبد الله بن يوسف أخبرنا مالك عن نافع

عن عبد الله بن عمر رضي الله عنهما

أن عمر بن الخطاب حمل على فرس في سبيل الله فوجده يباع فأراد أن يبتاعه فسأل رسول الله ﷺ فقال لا تبتعه ولا تعد في صدقتك

البخاري 3002صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Jihad and expeditions
Chapter
If one gave a horse in charity and then saw it being sold
Numbering
Darussalam 3002
Bukhari 3002