The Messenger of Allah ﷺ said, "Whoever stands in prayer during Ramadan out of faith and seeking reward will have his past sins forgiven."
إن رسول الله ﷺ قال: من قام رمضان إيمانا واحتسابا غفر له ما تقدم من ذنبه.
Bukhari narrated it in the Book of Faith (37), and Muslim narrated it in the Book of the Prayer of Travelers (759), both from the hadith of Malik, from Ibn Shihab, from Humayd bin Abdul-Rahman, from Abu Hurairah, who said, and then he mentioned it. The hadith of Malik from Ibn Shihab from Humayd bin Abdul-Rahman is not found in the version transmitted by Yahya Laythi. Ibn Abdul-Barr confirmed this in Tamhid (7/97).