(59) باب إِذَا هَمَّ الْعَبْدُ بِحَسَنَةٍ كُتِبَتْ وَإِذَا هَمَّ بِسَيِّئَةٍ لَمْ تُكْتَبْ
It is narrated on the authority of Abu Huraira that the Messenger of Allah (ﷺ) said:
The Great and the Glorious Lord said (to angels): Whenever My bondsman intends to corn it an evil, do not record it against him, but if he actually commits it, then write it as one evil. And when he intends to do good but does not do it, then take it down is one act of goodness, but if he does it, then write down ten good deeds (in his record).
Reference: Sahih Muslim 128 a
In-book reference: Book 1, Hadith 241
USC-MSA web (English) reference(deprecated numbering scheme): Book 1, Hadith 233