Nafi reported,

When the people of Medina renounced their allegiance to Yazid bin Muawiya, Ibn Umar gathered his household and children and said, "I heard the Prophet ﷺ say, 'A banner will be raised for every treacherous person on the Day of Resurrection.' We have pledged allegiance to this man according to the covenant of Allah and His Messenger, and I know of no treachery greater than for a man to pledge allegiance to another according to the covenant of Allah and His Messenger, and then to take up arms against him. I warn you, if any of you renounces his allegiance to him or gives allegiance to anyone else in this matter, that will be the parting between me and him."

Bukhari 7111

Sahih

حدثنا سليمان بن حرب حدثنا حماد بن زيد عن أيوب

عن نافع قال

لما خلع أهل المدينة يزيد بن معاوية جمع ابن عمر حشمه وولده فقال إني سمعت النبي ﷺ يقول ينصب لكل غادر لواء يوم القيامة وإنا قد بايعنا هذا الرجل على بيع الله ورسوله وإني لا أعلم غدرا أعظم من أن يبايع رجل على بيع الله ورسوله ثم ينصب له القتال وإني لا أعلم أحدا منكم خلعه ولا بايع في هذا الأمر إلا كانت الفيصل بيني وبينه

البخاري 7111صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tribulations
Chapter
If one says something in the presence of a people then leaves and says otherwise
Numbering
Darussalam 7111
Bukhari 7111