The Messenger of Allah ﷺ said, "The example of one who takes back what he has given is like a dog that vomits and then eats its vomit. If a giver takes back his gift, let him be brought forward and made known for what he has reclaimed, then let what he gave be handed over to him."
عن رسول الله ﷺ قال: مثل الذي يسترد ما وهب كمثل الكلب يقيء، فيأكل قيئه، فإذا استرد الواهب فليوقف، فليعرف بما استرد، ثم ليدفع إليه ما وهب.
Abu Dawud (3540) narrated it from Sulayman bin Dawud Mahri, from Ibn Wahb, who said, Usama bin Zayd told me, from Amr bin Shuayb, and he related it. Ahmad (6629) also narrated it from Abu Bakr Hanafi, from Usama bin Zayd, and he related it.Its chain of transmission is hasan because of Usama bin Zayd and his teacher Amr bin Shuayb, for both of them are graded hasan in hadith.As for his saying, "if the giver takes it back," this means after having heard the comparison to the dog that returns to its vomit. The giver has more right to his gift as long as no compensation has been given for it, but he is like the dog that returns to its vomit. If he wishes he may take it back, and if he wishes he may leave it. In this there is a warning and caution against reclaiming a gift once given.