Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:20549Abū Zakariyyā b. Abū Isḥāq al-Muzakkī

[Machine] In His saying, {and never accept their testimony}, {except for those who repent}, {and those are the defiantly disobedient} [An-Nur 4] Then He said, meaning {unless they repent} [Al-Baqarah 160] So, whoever repents and reforms, his testimony will be accepted in the Book of Allah.  

البيهقي:٢٠٥٤٩أَخْبَرَنَا أَبُو زَكَرِيَّا بْنُ أَبِي إِسْحَاقَ الْمُزَكِّي أنبأ أَبُو الْحَسَنِ الطَّرَائِفِيُّ ثنا عُثْمَانُ بْنُ سَعِيدٍ ثنا عَبْدُ اللهِ بْنُ صَالِحٍ عَنْ مُعَاوِيَةَ بْنِ صَالِحٍ عَنْ عَلِيِّ بْنِ أَبِي طَلْحَةَ عَنِ ابْنِ عَبَّاسٍ

فِي قَوْلِهِ تَعَالَى {وَلَا تَقْبَلُوا لَهُمْ شَهَادَةً أَبَدًا وَأُولَئِكَ هُمُ الْفَاسِقُونَ} [النور 4] ثُمَّ قَالَ يَعْنِي {إِلَّا الَّذِينَ تَابُوا} [البقرة 160] فَمَنْ تَابَ وَأَصْلَحَ فَشَهَادَتُهُ فِي كِتَابِ اللهِ تُقْبَلُ