فَإِنْ خِفْتُمْ فَرِجَالًا أَوْ رُكْبَانًا ۖ فَإِذَآ أَمِنتُمْ فَٱذْكُرُوا۟ ٱللَّهَ كَمَا عَلَّمَكُم مَّا لَمْ تَكُونُوا۟ تَعْلَمُونَ Qur’an Al-Baqara (2:239)Fain khiftum farijalan aw rukbanan faitha amintum faothkuroo Allaha kama AAallamakum ma lam takoonoo taAAlamoona
This relates to any dangerous situation - for instance, in war - where remaining for any length of time at one place would only increase the peril: in such an event, the obligatory prayers may be offered in any way that is feasible, even without consideration of the qiblah.
Verses 238-39 are parenthetical, introducing the subject of prayer in danger. This is more fully dealt with in iv. 101-03.