What you have experienced is as Moses wrote in the Scriptures about Abraham. He wrote that Abraham trusted God, and as a result, he was considered as being righteous {God erased the record of his sins}.