3:152
وَ لَ قَدْ صَدَقَ كُمُ ٱللَّهُ وَعْدَ هُۥٓ إِذْ تَحُسُّ ونَ هُم بِ إِذْنِ هِۦ حَتَّىٰٓ إِذَا فَشِلْ تُمْ وَ تَنَٰزَعْ تُمْ فِى ٱلْ أَمْرِ وَ عَصَيْ تُم مِّنۢ بَعْدِ مَآ أَرَىٰ كُم مَّا تُحِبُّ ونَ مِن كُم مَّن يُرِيدُ ٱل دُّنْيَا وَ مِن كُم مَّن يُرِيدُ ٱلْ ءَاخِرَةَ ثُمَّ صَرَفَ كُمْ عَنْ هُمْ لِ يَبْتَلِيَ كُمْ وَ لَ قَدْ عَفَا عَن كُمْ وَ ٱللَّهُ ذُو فَضْلٍ عَلَى ٱلْ مُؤْمِنِينَ
And Allah had certainly fulfilled His promise to you when you were killing the enemy by His permission until [the time] when you lost courage and fell to disputing about the order [given by the Prophet] and disobeyed after He had shown you that which you love. Among you are some who desire this world, and among you are some who desire the Hereafter. Then he turned you back from them [defeated] that He might test you. And He has already forgiven you, and Allah is the possessor of bounty for the believers.