Language:
كتاب الرقاق
81  
To make the Heart Tender (Ar-Riqaq)
(31)
Chapter: Whoever intended to do a good deed or a bad deed
(31)
باب مَنْ هَمَّ بِحَسَنَةٍ أَوْ بِسَيِّئَةٍ
Sahih al-Bukhari 6491

Narrated Ibn `Abbas:

The Prophet (ﷺ) narrating about his Lord I'm and said, "Allah ordered (the appointed angels over you) that the good and the bad deeds be written, and He then showed (the way) how (to write). If somebody intends to do a good deed and he does not do it, then Allah will write for him a full good deed (in his account with Him); and if he intends to do a good deed and actually did it, then Allah will write for him (in his account) with Him (its reward equal) from ten to seven hundred times to many more times: and if somebody intended to do a bad deed and he does not do it, then Allah will write a full good deed (in his account) with Him, and if he intended to do it (a bad deed) and actually did it, then Allah will write one bad deed (in his account) ."

حَدَّثَنَا أَبُو مَعْمَرٍ، حَدَّثَنَا عَبْدُ الْوَارِثِ، حَدَّثَنَا جَعْدٌ أَبُو عُثْمَانَ، حَدَّثَنَا أَبُو رَجَاءٍ الْعُطَارِدِيُّ، عَنِ ابْنِ عَبَّاسٍ ـ رضى الله عنهما ـ عَنِ النَّبِيِّ صلى الله عليه وسلم فِيمَا يَرْوِي عَنْ رَبِّهِ عَزَّ وَجَلَّ قَالَ قَالَ ‏ "‏ إِنَّ اللَّهَ كَتَبَ الْحَسَنَاتِ وَالسَّيِّئَاتِ، ثُمَّ بَيَّنَ ذَلِكَ فَمَنْ هَمَّ بِحَسَنَةٍ فَلَمْ يَعْمَلْهَا كَتَبَهَا اللَّهُ لَهُ عِنْدَهُ حَسَنَةً كَامِلَةً، فَإِنْ هُوَ هَمَّ بِهَا فَعَمِلَهَا كَتَبَهَا اللَّهُ لَهُ عِنْدَهُ عَشْرَ حَسَنَاتٍ إِلَى سَبْعِمِائَةِ ضِعْفٍ إِلَى أَضْعَافٍ كَثِيرَةٍ، وَمَنْ هَمَّ بِسَيِّئَةٍ فَلَمْ يَعْمَلْهَا كَتَبَهَا اللَّهُ لَهُ عِنْدَهُ حَسَنَةً كَامِلَةً، فَإِنْ هُوَ هَمَّ بِهَا فَعَمِلَهَا كَتَبَهَا اللَّهُ لَهُ سَيِّئَةً وَاحِدَةً ‏"‏‏.‏
Reference : Sahih al-Bukhari 6491
In-book reference : Book 81, Hadith 80
USC-MSA web (English) reference : Vol. 8, Book 76, Hadith 498
  (deprecated numbering scheme)