Abdullah bin Abbas reported,

A man from the Ansar accepted Islam, then turned back and joined those who committed shirk. Later he felt remorse, so he sent word to his people, "Ask the Messenger of Allah ﷺ for me whether there is any way for me to repent."So his people came to the Messenger of Allah ﷺ and said, "So-and-so has become remorseful, and he asked us to inquire of you whether there is any repentance available to him."Then this was revealed, "How shall Allah guide a people who disbelieved after their belief" up to His words, "Forgiving and Merciful" [Al Imran 3:86–89].So he sent word to the man, and he accepted Islam.

Azami 7038

Sahih

عن ابن عباس قال

كان رجل من الأنصار أسلم، ثم ارتد، ولحق بالشرك، ثم تندم، فأرسل إلى قومه: سلوا لي رسول الله ﷺ هل لي من توبة؟ فجاء قومه إلى رسول الله ﷺ فقالوا: إن فلانا قد ندم وأنه أمرنا أن نسألك: هل له من توبة؟ فنزلت: {كيف يهدى الله قوما كفروا بعد إيمنهم} إلى قوله {غفور رحيم} [آل عمران: ٨٦-٨٩]. فأرسل إليه فأسلم.

الأعظمي 7038صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Apostate, those who wage war, and whoever insults the Messenger
Section
Repentance of the apostate
Numbering
Jami al-Kamil 7038 (2nd edition)
Azami 7038