It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) conveyed the statement of Allah, that: "Allah has written down good deeds and sins. If a person intends to do a good deed and then does it, ten to seven hundred rewards, or even more as Allah wills, are written for him. If he does not do the good deed, then just for the intention, one good deed is written for him. And if a person intends to commit a sin and then commits it, only one sin is written against him. But if he does not commit the sin after intending it, then one good deed is written for him."
Hadith Referenceمسند احمد / ومن مسند بني هاشم / 2827
Hadith Gradingحکم دارالسلام:حديث صحيح، وهذا إسناد حسن