ʿUmar bin Al-Khattab gave a horse in charity in Allah's Cause and later he saw it being sold in the market and intended to purchase it. Then he went to the Prophet ﷺ and asked his permission. The Prophet said, "Do not take back what you have given in charity." For this reason, Ibn ʿUmar never purchased the things which he had given in charity, and in case he had purchased something (unknowingly) he would give it in charity again.
أَنْ يَشْتَرِيَهُ ثُمَّ أَتَى النَّبِيَّ ﷺ فَاسْتَأْمَرَهُ فَقَالَ لاَ تَعُدْ فِي صَدَقَتِكَ فَبِذَلِكَ كَانَ ابْنُ عُمَرَ ؓ لاَ يَتْرُكُ أَنْ يَبْتَاعَ شَيْئًا تَصَدَّقَ بِهِ إِلاَّ جَعَلَهُ صَدَقَةً