It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that a man of the Ansar apostatised and joined (the people of) Makkah. Then he regretted it and sent word to his people: "Ask the Messenger of Allah (peace and blessings be upon him) on my behalf whether there is (any room for) repentance for me." So Allah Almighty revealed this verse: "How shall Allah guide a people who disbelieved after their belief, and had borne witness that the Messenger is true" (to the end of the verse). Then they wrote this verse to him, so he came back and accepted Islam (again).