(59) باب إِذَا هَمَّ الْعَبْدُ بِحَسَنَةٍ كُتِبَتْ وَإِذَا هَمَّ بِسَيِّئَةٍ لَمْ تُكْتَبْ
This hadith has been narrated with another chain of transmitters with the addition of these words:
Allah would even wipe out (the evil committed by a man) and Allah does not put to destruction anyone except he who is doomed to destruction. (RU)
Reference (RU): Sahih Muslim 131 b (RU)
In-book reference (RU): Book 1, Hadith 246 (RU)
USC-MSA web (English) reference(deprecated numbering scheme): Book 1, Hadith 238 (RU)