Jundub said that God’s messenger told of a man saying, “I swear by God that God will not forgive so and so,” whereupon God most high said, “Who is this who swears that I will not forgive so and so? For I have forgiven so and so and have made your deeds to come to nothing”, or words to that effect.
Abu Huraira said that God’s messenger told of a man who committed a sin and said, "My Lord, I have sinned, so forgive me.” His Lord replied, “Does my servant know that he has a Lord who pardons sin and punishes for it? I have pardoned my servant." After remaining such time as God willed he committed a sin and said, “My Lord, I have committed another sin, so forgive me.” He replied, “Does my servant know that he has a Lord who pardons sin and punishes for it? I have pardoned my servant, so let him do what he likes.”
Shaddad b. Aus reported God’s messenger as saying that the best manner of asking pardon is to say, “O God, Thou art my Lord. There is no god but Thee. Thou hast created me, and I am Thy servant and hold to Thy covenant and promise as much as I can. I seek refuge in Thee from the evil of what I have done. I acknowledge Thy favour to me, and I acknowledge my sin. Pardon me, for none but Thee pardons sins.” He said that if anyone says it during the day-time with firm belief in it and dies that day before evening, he will be one of those who go to paradise; and if anyone says it during the night with firm belief in it and dies before morning, he will be one of those who go to paradise.
Anas reported God’s messenger as saying, "God is more pleased with the repentance of His servant when he turns penitently towards Him than one of you would be if his riding-beast which was carrying his food and drink escaped from him in a waterless desert and he, despairing of recovering it, went and lay down in the shade of a tree, then suddenly saw it standing beside him and, seizing its halter, said from excess of joy, ‘O God, Thou art my servant and I am Thy lord’, making a mistake from excess of joy.”