Sunan an-Nasa'i, Book 22, Hadith 109 (In-Book) ⓘ
It was narrated that Abu Hurairah said: "The Messenger of Allah used to encourage (us) to pray Qiyam during Ramadan, without insisting on that, and he said: 'Whoever spends the nights of Ramadan in prayer (Qiyam) out of faith and in the hope of reward, he will be forgiven his previous sins'
أَخْبَرَنَا نُوحُ بْنُ حَبِيبٍ، قَالَ حَدَّثَنَا عَبْدُ الرَّزَّاقِ، قَالَ أَنْبَأَنَا مَعْمَرٌ، عَنِ الزُّهْرِيِّ، عَنْ أَبِي سَلَمَةَ، عَنْ أَبِي هُرَيْرَةَ، قَالَ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يُرَغِّبُ فِي قِيَامِ رَمَضَانَ مِنْ غَيْرِ أَنْ يَأْمُرَهُمْ بِعَزِيمَةٍ قَالَ " مَنْ قَامَ رَمَضَانَ إِيمَانًا وَاحْتِسَابًا غُفِرَ لَهُ مَا تَقَدَّمَ مِنْ ذَنْبِهِ " .
also referenced under: Hadith 2198 (Reference) & Volume 3, Book 22, Hadith 2200 (DarusSalam)