The Prophet ﷺ said that Allah said, "If My servant intends to do a good deed, record it. If he carries it out, record it as ten of its like. If he intends to do a bad deed, do not record it. If he carries it out, record it as a single bad deed. But if he abandons it, record it as a good deed."
حدثنا سفيان حدثنا أبو الزناد عن الأعرج
عن النبي ﷺ قال قال الله عز وجل إن هم عبدي بحسنة فاكتبوه فإن عملها فاكتبوها بعشر أمثالها وإن هم بسيئة فلا تكتبوها فإن عملها فاكتبوها بمثلها فإن تركها فاكتبوها حسنة
Its isnad is sahih. Abu Zinad, with the zay vowelled by a kasra, is Abdul-Aziz bin Zakwan, whose kunya was Abu Abdul-Rahman, and Abu Zinad was an epithet by which he came to be known. He was a trustworthy successor (a thiqah tabii), and Sufyan used to call him "the commander of the faithful in hadith."Ibn Madini said, "Among the great successors in Madinah, none was more knowledgeable than him and Ibn Shihab." ... ...Ibn Abu Hatim said in his biographical entry (49/2/2-50), "My father was asked about Abu Zinad, and he said, 'Trustworthy, a jurist, a man of sunnah, and he is among those whose narration establishes proof when trustworthy narrators report from him.'" Bukhari gave his biography in al-Saghir (154), and Dhahabi in Tadhkirat Huffaz 1:126-127.This hadith was related by Muslim (1:47), in similar wording, through Sufyan bin Uyayna, with this same isnad. It was also related by Bukhari (13:391), at greater length, through Mughira bin Abdul-Rahman, from Abu Zinad. Its meaning has already appeared at greater length than this, at (7195). See also Fath al-Bari 11:277-283, where the hadith of Ibn Abbas on this subject is given a thorough explanation. The hadith of Ibn Abbas has already appeared in his Musnad at (2001, 2519).As for the phrase, "If My servant intends a good deed, then write it down," this is how it stands in the source manuscripts here, "faktubuhu," and a sign of correctness was marked above it in both manuscripts. It can be explained as meaning, "write it down for them as a good deed" (faktubu lahum bil-hasanah). In the rest of the narrations we have seen, the wording is "faktubuha."