عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ رَضِيَ اللَّهُ عَنْهُ قَالَ: سَمِعْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ يَقُولُ: ((مَنْ صَامَ رَمَضَانَ وَعَرَفَ حُدُودَهُ، وَتَحَفَّظَ مِمَّا كَانَ يَنْبَغِي بِهِ أَنْ يَتَحَفَّظَ فِيهِ، كَفَّرَ مَا كَانَ قَبْلَهُ))
It is narrated from Sayyiduna Abu Sa'id Khudri (may Allah be pleased with him) that I heard the Messenger of Allah (peace and blessings be upon him) say: Whoever fasted during the month of Ramadan, observed its limits, and refrained from what should be avoided, then this act will be an expiation for his previous sins.