(إِلَّا الَّذِينَ عَاهَدتُّم مِّنَ الْمُشْرِكِينَ…) (Excepted are those with whom you made a treaty among the polytheists): Here is a conditional exception. The Prophet Muhammad (saws) sent Imam Ali (may Allah honor his face) with Surah Bara’ah (At-Tawbah) to nullify all types of agreements and covenants with the polytheists of Quraysh, specifically referring to the Treaty of Hudaybiyyah. This has been mentioned in the preceding verses. Here, Allah (swt) gives exception to the polytheists who have not blocked trade with you and have not tried to cause any harm to you.
(…ثُمَّ لَمْ يَنقُصُوكُمْ شَيْئًا…) (And then they have not been deficient toward you in anything): Then they did not cause to diminish anything from your wealth.
(…وَلَمْ يُظَاهِرُوا عَلَيْكُمْ أَحَدًا…) (Or supported anyone against you): And they did not support any of your enemies against you. If anyone from the polytheists among some of the tribes was found to refrain from such actions, thus fulfill the covenant and agreement with them. A Muslim should not break agreements and treaties unless the enemies breach them and betray the trust of the pacts that have been established.
(…فَأَتِمُّوا إِلَيْهِمْ عَهْدَهُمْ إِلَىٰ مُدَّتِهِمْ…) (So, complete for them their treaty until their term [has ended].): So, fulfill their covenant for the specified term.
(إِنَّ اللَّهَ يُحِبُّ الْمُتَّقِينَ) (Indeed, Allah loves those who are mindful [of Him].): The mindful person, is one who does what Allah commands and avoids what He (swt) prohibits. Taqwa (piety) is the gathering of all goodness, in embodying righteousness in every action and abstaining from every forbidden deed.