Ibn Abbas (may Allah be pleased with them both) said concerning this saying of Allah Almighty: "Never accept their testimony, for they are the defiantly disobedient" [Surah al-Nur: 4]; then He said: "Except those who repent" [Surah al-Baqarah: 160]. Whoever repents, his testimony will be accepted; this is in the Qur'an of Allah.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / 20549