Abu Imran relates that it is narrated from Sayyiduna Jundub (may Allah be pleased with him): A man swore that Allah would not forgive so-and-so. So Allah, the Mighty and Majestic, revealed to His Prophet (peace and blessings be upon him) - or to a prophet - that this oath is equivalent to a sin, so he should begin his deeds anew.
Hadith Referenceالمعجم الكبير للطبراني / باب الجيم / 1667