Abu Hurairah reported,

The Messenger of Allah ﷺ said that Allah عز وجل said, "When My servant intends a good deed but does not carry it out, I record it for him as one good deed. If he carries it out, I record it for him as ten good deeds, up to seven hundred times over. When he intends a bad deed but does not carry it out, I do not record it against him. If he carries it out, I record it as a single bad deed."

Azami 15082

Sahih

عن أبي هريرة

عن رسول الله ﷺ قال: قال الله عز وجل: إذا هم عبدي بحسنة ولم يعملها كتبتها له حسنة، فإن عملها كتبتها عشر حسنات إلى سبعمائة ضعف. وإذا هم بسيئة ولم يعملها لم أكتبها عليه، فإن عملها كتبتها سيئة واحدة.

الأعظمي 15082صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Asceticism and softening of the heart
Chapter
Virtue of asceticism and softening of hearts
Section
If a servant intends a good deed it is recorded, and if he intends a bad deed it is not recorded
Numbering
Jami al-Kamil 15082 (2nd edition)
Azami 15082