Sunan an-Nasa'i, Book 23, Hadith 182 (Nasa'i 2621)

It was narrated from 'Umar that:

he gave someone a horse to ride in the cause of Allah, then he saw it offered for sale and wanted to buy it. The Prophet said to him: "Do not think of buying back what you have given in charity."