The Messenger of Allah ﷺ said, "Whoever stands in prayer during Ramadan out of faith and seeking reward will have his past sins forgiven."
أخبرنا محمد بن إسمعيل أبو بكر قال حدثنا عبد الله بن محمد بن أسماء قال حدثنا جويرية عن مالك قال قال الزهري أخبرني أبو سلمة بن عبد الرحمن وحميد بن عبد الرحمن
أن رسول الله ﷺ قال من قام رمضان إيمانا واحتسابا غفر له ما تقدم من ذنبه
[Its chain of transmission is sahih] Ahmad narrated it, 2/529, from the hadith of Malik through the same route, but Humayd bin Abdul-Rahman is not mentioned in it. Something similar is found in Muwatta (Yahya's recension), 1/113, and Ibn Khuzayma graded it sahih, no. 2202. Bukhari narrated it, no. 2008, and Muslim, no. 759. See the previous hadith, from the hadith of Zuhri through the same route. Muslim also narrated it, no. (missing), from the hadith of Malik, from Zuhri, from Humayd bin Abdul-Rahman, through the same route. (no.