Excerpted from Does God Change His Mind? Divine Repentance by Calvinist R.C. Sproul:
The biblical narratives in which God appears to repent, or change His mind, are almost always narratives that deal with His threats of judgment and punishment. These threats are then followed by the repentance of the people or by the intercessory petitions of their leaders. God is not talked into “changing His mind.” Out of His gracious heart He only does what He has promised to do all along – not punish sinners who repent and turn from their evil ways. He chooses not to do what He has every right to do.
The point of these narratives is to encourage us to pray. We are to make intercession. The promised threats of divine punishment are given with the condition attached that if we repent, we ~vi1l escape those punishments. Sometimes that condition is spelled out explicitly, while at other times it is merely implied. When we repent, then God removes the threat of punishment. The question is, Who is ultimately repenting here? God never repents in the sense that He turns away from sin or from error.
God is not a man. He does not ultimately or literally have arms or legs. He does not repent as men repent. He listens to our prayers but is never corrected by them. He changes not- neither in the perfection of His being nor in the perfection of His thoughts.