Umar bin Khattab once gave a horse to be used 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 this, and he replied, "Do not buy it, and do not take back what you have given in charity."
حدثنا يحيى بن يحيى قال قرأت على مالك عن نافع
أن عمر بن الخطاب حمل على فرس في سبيل الله فوجده يباع فأراد أن يبتاعه فسأل رسول الله ﷺ عن ذلك فقال لا تبتعه ولا تعد في صدقتك