Mujahid (may Allah have mercy on him) says that Sayyiduna Umar (may Allah be pleased with him) said: "Whatever slave a man frees during his illness, that is a bequest; if he wishes, he may go back on his bequest."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المدبر / 21567