Karma and Forgiveness

First of all I want to thank you from my heart very much for changing my life. You put the light on my way to get to know God better than ever! Your words are just the message that God ever wanted me to know!
I have a question for long time:

In the law of karma what happens when you have been a “bad boy” for a long time, or you haven´t been who you must be (as a good father, as a fried, as a human being) but with the time you realize you have made things wrong and you regret it and decide you have and want to change your thoughts and your form of living and you become a new spiritual human being
Does it affect somehow your karma, I mean the responsibility you have to take your acts before you change your thoughts? What role does forgiveness play in all this?

I hope you can understand my question. Your inspiration helped me to start writing in English, but I have to practice more
with love from Colombia.