Buraidah said A woman came to the Messenger of Allah ﷺ and said I gave a slave girl as sadaqah to my mother who has now died and has left that slave girl. He said your reward is sure and the inheritance has given her back to you. (Using translation from Abū Dāʾūd 1656)
أَنَّ امْرَأَةً أَتَتْ رَسُولَ اللهِ ﷺ فَقَالَتْ إِنِّي كُنْتُ تَصَدَّقْتُ عَلَى أُمِّي بِوَلِيدَةٍ وَإِنَّهَا مَاتَتْ وَتَرَكَتْ تِلْكَ الْوَلِيدَةَ فَقَالَ «وَجَبَ أَجْرُكِ وَرَجَعَتْ إِلَيْكِ فِي الْمِيرَاثِ»