فَلَ تَهِنُوا
...
So do not lose heart,
meaning, do not be weak concerning the enemies.
...
وَتَدْعُوا إِلَى السَّلْمِ
...
and beg for peace,
meaning, compromise, peace, and ending the fighting between you and the disbelievers while you are in a position of power, both in great numbers and preparations.
Thus, Allah says,
فَلَ تَهِنُوا وَتَدْعُوا إِلَى السَّلْمِ
وَأَنتُمُ الاْأَعْلَوْنَ
...
So do not lose heart and beg for peace while you are superior.
meaning, in the condition of your superiority over your enemy.
If, on the other hand, the disbelievers are considered more powerful and numerous than the Muslims, then the Imam (general commander) may decide to hold a treaty if he judges that it entails a benefit for the Muslims. This is like what Allah's Messenger did when the disbelievers obstructed him from entering Makkah and offered him treaty in which all fighting would stop between them for ten years. Consequently, he agreed to that.
Allah then says:
...
وَاللَّهُ مَعَكُمْ
...
And Allah is with you,
This contains the good news of victory and triumph over the enemies.
...
وَلَن يَتِرَكُمْ أَعْمَالَكُمْ
and He will never deprive you of (the reward of) your deeds.
meaning, Allah will never invalidate your deeds, nullify them, or deprive you of them, but rather He will give you your rewards complete, without any reduction.
And Allah knows best.