They had pledged to God in the past that they would not turn around and flee; making a pledge with God involves a great responsibility.
وَلَقَد كانوا عٰهَدُوا اللَّهَ مِن قَبلُ لا يُوَلّونَ الأَدبٰرَ وَكانَ عَهدُ اللَّهِ مَسـٔولًا
wa laqad kaanoo ‘aahadul laaha min qablu laa yuwal loonal adbaar; wa kaana ‘ahdul laahi mas’oolaa