Narrated `Abdullah bin 'Amir bin Rabi`a
`Umar bin Al-Khattab left for Sham, and when he reached a placed called Sargh, he came to know that there was an outbreak of an epidemic (of plague) in Sham. Then `AbdurRahman bin `Auf told him that Allah's Messenger (ﷺ) said, "If you hear the news of an outbreak of an epidemic (plague) in a certain place, do not enter that place: and if the epidemic falls in a place while you are present in it, do not leave that place to escape from the epidemic." So `Umar returned from Sargh.
Narrated 'Amir bin Sa`d bin Abi Waqqas
That he heard Usama bin Zaid speaking to Sa`d, saying, "Allah's Messenger (ﷺ) mentioned the plague and said, 'It is a means of punishment with which some nations were punished and some of it has remained, and it appears now and then. So whoever hears that there is an outbreak of plague in some land, he should not go to that land, and if the plague breaks out in the land where one is already present, one should not run away from that land, escaping from the plague."