Mathew Henry's Commentary says:
IV. God graciously abated the rigour of the sentence, and repented of the evil he thought to do (Exod. 32:14); though he designed to punish them, yet he would not ruin them. See here, 1. The power of prayer; God suffers himself to be prevailed with by the humble believing importunity of intercessors. 2. The compassion of God towards poor sinners, and how ready he is to forgive. Thus he has given other proofs besides his own oath that he has no pleasure in the death of those that die; for he not only pardons upon the repentance of sinners, but spares and reprieves upon the intercession of others for them.
firstcenturychristian.com says:
The answer to your question is found in the context of this scripture. While Moses was on Mt. Sinai, receiving the Ten Commandments the Hebrew people corrupted themselves by making and worshiping a golden calf. They attributed to the calf their deliverance from Egypt (32:6-8). This sacrilege incensed God and he said to Moses l, "That my wrath may wax hot against them, and that I may consume them..." (32:10). Moses pleaded with God begging that He would "turn from (his) fierce wrath and repent of this evil against (his) people" (32:12).God heard and accepted Moses intercessory petition and "repented of the evil which he said he would do unto his people." (32:14). The "evil" was his intention to utterly destroy the whole nation and start over again with Moses (32:10, 14). This was not a matter of moral evil, but an act of judgement which would impose harsh consequences on the people. Webster lists this as one of the definitions of "evil" "something that brings sorrow, distress or calamity."
Insight Volume says same thing.