Ibn Abi Najih (may Allah have mercy on him) says that if the slanderer (the one who makes an accusation) repents, then his testimony will be accepted in subsequent cases. The same is said by Ata, Tawus, and Mujahid (may Allah have mercy on them). Imam Shafi'i (may Allah have mercy on him) says that the judge of the time cannot force anyone to keep something as a trust.
Hadith Referenceالسنن المأثورة / باب تفسير الفرعة والعتيرة / 411
Hadith Takhrijالسنن الكبرى للبيهقى: 153/10 ، مصنف عبدالرزاق: 383/7 ۔