The Prophet ﷺ said: The similitude of the one who takes back what he gifted is like that of a dog which vomits and then it eats vomit. When a donor seeks to take back (his gift), it should be made known and he informed why he sought to take it back. Then whatever he donated should be returned to him.
عَنْ رَسُولِ اللَّهِ ﷺ قَالَ مَثَلُ الَّذِي يَسْتَرِدُّ مَا وَهَبَ كَمَثَلِ الْكَلْبِ يَقِيءُ فَيَأْكُلُ قَيْئَهُ فَإِذَا اسْتَرَدَّ الْوَاهِبُ فَلْيُوَقَّفْ فَلْيُعَرَّفْ بِمَا اسْتَرَدَّ ثُمَّ لِيُدْفَعْ إِلَيْهِ مَا وَهَبَ