With the nation reeling from a plague that ravaged them due to Bilam and Balak’s scheme, Hashem orders an assault on the perpetrators, Moshe’s final act of leadership:

וַיְדַבֵּר ה’ אֶל מֹשֶׁה לֵּאמֹר נְקֹם נִקְמַת בְּנֵי יִשְׂרָאֵל מֵאֵת הַמִּדְיָנִים אַחַר תֵּאָסֵף אֶל עַמֶּיךָ וַיְדַבֵּר מֹשֶׁה אֶל הָעָם לֵאמֹר הֵחָלְצוּ מֵאִתְּכֶם אֲנָשִׁים לַצָּבָא וְיִהְיוּ עַל מִדְיָן לָתֵת נִקְמַת ה’ בְּמִדְיָן – God spoke to Moshe saying, “Take revenge for the children of Israel against Midian; afterwards you will be gathered to your people (=die).” So Moshe spoke to the people, saying, “Equip yourselves for the army, that they can stand against Midian, and carry out the revenge of God in Midian.” (31:1-3)

Hashem told Moshe to avenge the fallen Jews against the Midian. But when Moshe gave the orders, he told them to carry God’s vengeance against Midian.

Why did he change the wording?

The Chanukas Hatorah explains that Moshe modified the instruction because if he were to tell them to avenge themselves, they would forgive their pride in an effort to keep Moshe alive. The spies had already erred in trying to second guess who ought to lead; there would be no mistake this time. Moshe purposely told them to carry out God’s vengeance; they couldn’t say no to that!