`Umar gave a horse to be used in Allah's Cause, but later on he found it being sold. So, he intended to buy it and asked Allah's Messenger (ﷺ) who said, "Don't buy it and don't take back your gift of charity."
Sahih al-Bukhari Book 56, Hadith 180