(Imam Bukhari narrates that) Isma'il narrated to us, he said: Imam Malik narrated to me, from Ibn Shihab, from Humaid bin Abdur Rahman, from Hazrat Abu Hurairah (may Allāh be pleased with him), he says that the Messenger of Allāh ﷺ said:
Whoever stood (in prayer) in Ramadan with faith and seeking reward, his previous sins will be forgiven.
حَدَّثَنَا إِسْمَاعِيلُ قَالَ: حَدَّثَنِي مَالِكٌ، عَنِ ابْنِ شِهَابٍ، عَنْ حُمَيْدِ بْنِ عَبْدِ الرَّحْمَنِ، عَنْ أَبِي هُرَيْرَةَ : أَنَّ رَسُولَ اللهِ ﷺ قَالَ
مَنْ قَامَ رَمَضَانَ إِيمَانًا وَاحْتِسَابًا غُفِرَ لَهُ مَا تَقَدَّمَ مِنْ ذَنْبِهِ.
Reference: Sahih Al Bukhari 37