The Book of the Prohibited actions
Riyad as-Salihin #1031
كتاب الأمور المنهي عنها
وعنه قال: قال رسول الله صلى الله عليه وسلم: «من حلف فقال: إني بريء من الإسلام، فإن كان كاذبًا، فهو كما قال، وإن كان صادقًا، فلن يرجع إلى الإسلام سالمًا». ((رواه أبو داود))
Buraidah (May Allah be pleased with him) reported:
The Messenger of Allah (ﷺ) said, “If anyone swears that in such and such case he will be free from Islam and afterwards he turns out to be a liar, he will be as he has sworn; but if he is speaking the truth, he will not revert safely to Islam.”.
وعنه قال: قال رسول الله صلى الله عليه وسلم : "من حلف فقال: إني بريء من الإسلام، فإن كان كاذبًا، فهو كما قال، وإن كان صادقًا، فلن يرجع إلى الإسلام سالمًا". ((رواه أبو داود))
The Messenger of Allah (ﷺ) said, "If anyone swears that in such and such case he will be free from Islam and afterwards he turns out to be a liar, he will be as he has sworn; but if he is speaking the truth, he will not revert safely to Islam.".
— Riyad as-Salihin, Hadith 1031