Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:9:117

Allah has already forgiven the Prophet and the Muhajireen and the Ansar who followed him in the hour of difficulty after the hearts of a party of them had almost inclined ˹to doubt˺, and then He forgave them. Indeed, He was to them Kind and Merciful.  

God has truly relented, that is, He has ˹truly˺ perpetuated His relenting, to the Prophet and the Emigrants and the Helpers who followed him in the hour of hardship, that is, during the time of this ˹hardship˺, which was their predicament during the raid at Tabūk, where two men would share a single date, ten men would take turns on one camel, and where the heat became so intense that they resorted to drinking filth; after the hearts of a party of them had almost deviated (read either as tazīghu or yazīghu), ˹had almost˺ inclined away from following him, in favour of staying behind due to the hardship that afflicted them, then He relented to them, by making them steadfast. Truly He is Gentle, Merciful to them.
القرآن:٩:١١٧

لَقَدْ تَابَ اللَّهُ عَلَى النَّبِيِّ وَالْمُهَاجِرِينَ وَالْأَنْصَارِ الَّذِينَ اتَّبَعُوهُ فِي سَاعَةِ الْعُسْرَةِ مِنْ بَعْدِ مَا كَادَ يَزِيغُ قُلُوبُ فَرِيقٍ مِنْهُمْ ثُمَّ تَابَ عَلَيْهِمْ ۚ إِنَّهُ بِهِمْ رَءُوفٌ رَحِيمٌ  

{لقد تاب الله} أي أدام توبته {على النبي والمهاجرين والأنصار الذين اتبعوه في ساعة العُسرة} أي وقتها، وهي حالهم في غزوة تبوك كان الرجلان يقتسمان تمرة والعشرة يعتقبون البعير الواحد، واشتد الحر حتى شربوا الفرث {من بعد ما كاد تزيغ} بالتاء والياء تميل {قلوب فريق منهم} عن اتباعه إلى التخلف لما هم فيه من الشدة {ثم تاب عليهم} بالثبات {إنه بهم رؤوف رحيم}.