I came to Ibn Abbas and said, "Abu Abbas, I was with Ibn Umar when he recited a verse and wept."He asked, "Which verse?"I said, "Whether you disclose what is within yourselves or conceal it, Allah will bring you to account for it" [Baqarah 2:284].Ibn Abbas said, "When this verse was revealed, it distressed the companions of the Messenger of Allah ﷺ greatly and caused them severe anguish. They said, 'Messenger of Allah, we are ruined if we are to be held accountable for what we say and what we do. As for what is in our hearts, that is beyond our control.'The Messenger of Allah ﷺ said to them, 'Say, We hear and we obey.'So they said, 'We hear and we obey.'Then this verse abrogated it, 'The Messenger has believed in what was revealed to him from his Lord, and so have the believers' up to 'Allah does not burden a soul beyond its capacity. It will have what it has earned, and against it what it has acquired' [Baqarah 2:285–286]. So they were excused regarding the inner whisperings of the soul, and they were held accountable for their deeds."
دخلت على ابن عباس، فقلت: يا أبا عباس، كنت عند ابن عمر، فقرأ هذه الآية فبكى، قال: أية آية؟ قلت: {وإن تبدوا ما في أنفسكم أو تخفوه يحاسبكم به الله} قال ابن عباس: إن هذه الآية حين أنزلت، غمت أصحاب رسول الله ﷺ غما شديدا، وغاظتهم غيظا شديدا، يعني، وقالوا: يا رسول الله، هلكنا، إن كنا نؤاخذ بما نتكلم، وبما نعمل، فأما ما في قلوبنا فليس بأيدينا، فقال لهم رسول الله ﷺ: قولوا: سمعنا وأطعنا قالوا: سمعنا وأطعنا، قال: فنسختها هذه الآية: {آمن الرسول بما أنزل إليه من ربه والمؤمنون} إلى {لا يكلف الله نفسا إلا وسعها لها ما كسبت وعليها ما اكتسبت} فتجوز لهم عن حديث النفس، وأخذوا بالأعمال.
Ahmad (3070) and Ibn Jareer (5/133) both narrated it from the hadith of Abdul-Razzaq, it is in his Tafsir (1/113-114), who said, Mamar informed us, from Humayd al-Araj, from Mujahid, and he related it.Its isnad is hasan because of Humayd, who is Ibn Qays al-Makki al-Qari.The transmission from the companions, the successors, and those after them has come down through multiple independent channels affirming that Allah's saying, "And whether you disclose what is within yourselves or conceal it" was abrogated by the verse that follows it, because Allah
overlooks what passes through the mind so long as one does not speak it or act upon it, as is established in the sahih hadiths.