Sunan an-Nasa'i, Volume 5, Book 37, Hadith 4051 (DarusSalam)

It was narrated that Ibn 'Abbas said, : Concerning the statement of Allah, the Most High: The recompense of those who wage war against Allah and His Messenger. "This Verse was revealed concerning the idolators. Whoever among them repents before he is captured, you have no way against him. This Verse does not apply to the Muslims. Whoever kills, spreads mischief in the land, and wages war against Allah and His Messenger, then joins the disbelievers before he can be caught, there is nothing to prevent the Hadd punishment being carried out on him because of what he did."

أَخْبَرَنَا زَكَرِيَّا بْنُ يَحْيَى، قَالَ حَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ، قَالَ أَنْبَأَنِي عَلِيُّ بْنُ الْحُسَيْنِ بْنِ وَاقِدٍ، قَالَ حَدَّثَنِي أَبِي قَالَ، حَدَّثَنَا يَزِيدُ النَّحْوِيُّ، عَنْ عِكْرِمَةَ، عَنِ ابْنِ عَبَّاسٍ، فِي قَوْلِهِ تَعَالَى ‏{‏ إِنَّمَا جَزَاءُ الَّذِينَ يُحَارِبُونَ اللَّهَ وَرَسُولَهُ ‏}‏ الآيَةَ قَالَ نَزَلَتْ هَذِهِ الآيَةُ فِي الْمُشْرِكِينَ فَمَنْ تَابَ مِنْهُمْ قَبْلَ أَنْ يُقْدَرَ عَلَيْهِ لَمْ يَكُنْ عَلَيْهِ سَبِيلٌ وَلَيْسَتْ هَذِهِ الآيَةُ لِلرَّجُلِ الْمُسْلِمِ فَمَنْ قَتَلَ وَأَفْسَدَ فِي الأَرْضِ وَحَارَبَ اللَّهَ وَرَسُولَهُ ثُمَّ لَحِقَ بِالْكُفَّارِ قَبْلَ أَنْ يُقْدَرَ عَلَيْهِ لَمْ يَمْنَعْهُ ذَلِكَ أَنْ يُقَامَ فِيهِ الْحَدُّ الَّذِي أَصَابَ ‏.‏

sunnah.com