Abu Musa Ashari reported,

The Prophet ﷺ said, "My example and the example of what Allah has sent me with is like a man who came to a people and said, 'My people, I have seen the enemy army with my own eyes, and I am the naked warner, so flee for safety!' A group of his people obeyed him and slipped away under cover of night, traveling at their own pace, and they were saved. Another group disbelieved him and stayed where they were, so the army came upon them in the morning, destroyed them, and wiped them out. That is the example of one who obeys me and follows the truth I have brought, and the example of one who disobeys me and rejects the truth I have brought."

Bukhari 7283

Sahih

حدثنا أبو كريب حدثنا أبو أسامة عن بريد عن أبي بردة

عن أبي موسى

عن النبي ﷺ قال إنما مثلي ومثل ما بعثني الله به كمثل رجل أتى قوما فقال يا قوم إني رأيت الجيش بعيني وإني أنا النذير العريان فالنجاء فأطاعه طائفة من قومه فأدلجوا فانطلقوا على مهلهم فنجوا وكذبت طائفة منهم فأصبحوا مكانهم فصبحهم الجيش فأهلكهم واجتاحهم فذلك مثل من أطاعني فاتبع ما جئت به ومثل من عصاني وكذب بما جئت به من الحق

البخاري 7283صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Adhering to the Book and the Sunnah
Chapter
Following the sunnah of the Messenger of Allah ﷺ
Numbering
Darussalam 7283
Bukhari 7283