According to Verse 17 of Surah An-Nisa, “God will only accept the repentance of those who commit evil in ignorance, if they repent immediately. God is All-knowing and All-wise.”
First of all, if someone has done something wrong, it should be out of neglect and ignorance and dominance of worldly desires not due to obstinacy and opposition to the truth.
Second, a sign of sincerity in Tawbah is for one to repent soon after reaching awareness and changing attitude and not to keep doing the wrong deed for years.
So if someone does something wrong out of neglect and repent as soon as he learns about it being wrong, he should return to God immediately, as Adam (AS) did.
It is such a blessing that our Tawbah is accepted and it is such a golden opportunity for us to cleanse our existence of sins and wrongdoings.
And God is such a good and merciful teacher who gives us an exam everyday and the opportunity to make up for what we have missed and we have done wrong.
Arifs (mystics) have beautiful and delicate remarks about Tawbah. For example, prominent Arif Abolhassan Bushanji has said: “Whenever you remember a sin and no longer find joy and happiness in it, that is Tawbah.”
In other words, Tawbah is when a person is elevated from the stage in which he committed a sin to a higher level in which he finds no attraction in sin.