During the Farewell Pilgrimage, the Messenger of Allah ﷺ called upon the people to listen attentively, then said, "Do not return after me to disbelief, striking the necks of one another."
أخبرنا محمد بن بشار قال حدثنا محمد وعبد الرحمن قالا حدثنا شعبة عن علي بن مدرك قال سمعت أبا زرعة بن عمرو بن جرير
أن رسول الله ﷺ في حجة الوداع استنصت الناس قال لا ترجعوا بعدي كفارا يضرب بعضكم رقاب بعض
Bukhari narrated it in the chapters on Diyat, section "Whoever saves it," hadith 6869, and Muslim in the chapters on Iman, section explaining the meaning of the Prophet's ﷺ statement, "Do not revert to disbelief after me," etc., hadith 65, from Muhammad bin Bashshar Bundar, with this wording. It is also in Kubra, hadith 3596.