Umar bin Khattab gave a horse to be used in the cause of Allah. Later he wanted to buy it back, so he asked the Messenger of Allah ﷺ about it.The Prophet ﷺ said, "Do not buy it, and do not take back what you have given in charity."
أن عمر بن الخطاب حمل على فرس في سبيل الله، فأراد أن يبتاعه فسأل عن ذلك رسول الله ﷺ فقال: لا تبتعه، ولا تعد في صدقتك.
Malik narrated it in Zakat (50) from Nafi, from Ibn Umar, as mentioned.Bukhari narrated it in Jihad and Expeditions (3002) from Abdullah bin Yusuf, and Muslim narrated it in Gifts (1621) from Yahya bin Yahya, both of them from Malik.Bukhari narrated it in Zakat (1489) through another route from Ibn Umar, adding, "For that reason, Ibn Umar would never fail to buy back something he had given as charity, but he would make it charity again."