Reporting from the Prophet ﷺ, "Whoever fasts Ramadan out of faith and seeking reward will have his past sins forgiven, and whoever stands in prayer on Laylat al-Qadr out of faith and seeking reward will have his past sins forgiven."
حدثنا مخلد بن خالد وابن أبي خلف المعنى قالا حدثنا سفيان عن الزهري عن أبي سلمة
يبلغ به النبي ﷺ من صام رمضان إيمانا واحتسابا غفر له ما تقدم من ذنبه ومن قام ليلة القدر إيمانا واحتسابا غفر له ما تقدم من ذنبه
Bukhari reported it in the Book of the Virtue of Laylat al-Qadr, Chapter on the Virtue of Laylat al-Qadr, no. 2014, from the hadith of Sufyan bin Uyayna through this route.