It was narrated that the Prophet, peace and blessings be upon him, said: "Allah, The Almighty, commanded a slave to be taken to the Hellfire. When the slave stood at its edge, he turned and said, O my Lord, I swear that I thought good of you. Upon this Allah, The Almighty, said, 'Get him back for I am to my slave as he thinks of Me, (i.e. I am able to do for him what he thinks I can do for him) and He forgives him."
The Verification of the Hadeeth: Its Isnaad (i.e. chain of transmission) is weak.
It was reported by Al-Bayhaqi in Shu‘ab Al-Imaan (1028) from the route of a man from the children of ‘Ubaadah ibn As-Saamit from Abu Huriarah, may Allaah be pleased with him, and its Isnaad is weak due to the man who is from the children of ‘Ubaadah ibn As-Saamit who was not named.
Al-Munthiri said: "It was reported by Al-Bayhaqi from the route of a man from the children of ‘Ubaadah ibn As-Saamit whom Abu Huriarah, may Allaah be pleased with him, did not name. Refer to At-Targheeb wa Tarheeb (5132), Dha‘eef At-Targheeb (1976), Al-Jaami‘ Al-Kabeer (5678), Dha‘eef Al-Jaami‘ and As-Silsilah Adh-Dha‘eefah (6150)."