From a commenter:
Where did God actually “change” his mind?
There is a very helpful category on this page to answer your question:
God repents (changes His mind) throughout the Bible. So often does God do this that God laments:
Jer 15:6 You have forsaken Me,” says the LORD, “You have gone backward. Therefore I will stretch out My hand against you and destroy you; I am weary of relenting [repenting]!
God even declares that it is one of His general principles that He will change His mind based on circumstances:
Jer 18:7 The instant I speak concerning a nation and concerning a kingdom, to pluck up, to pull down, and to destroy it,
Jer 18:8 if that nation against whom I have spoken turns from its evil, I will relent of the disaster that I thought to bring upon it.
Jer 18:9 And the instant I speak concerning a nation and concerning a kingdom, to build and to plant it,
Jer 18:10 if it does evil in My sight so that it does not obey My voice, then I will relent concerning the good with which I said I would benefit it.
In this scenario, God both does not do what He thought He was going to do and does not do what He said He was going to do. We see this realized throughout the Bible:
1Sa 2:30 Therefore the LORD God of Israel says: ‘I said indeed that your house and the house of your father would walk before Me forever.’ But now the LORD says: ‘Far be it from Me; for those who honor Me I will honor, and those who despise Me shall be lightly esteemed.
Jon 3:10 Then God saw their works, that they turned from their evil way; and God relented from the disaster that He had said He would bring upon them, and He did not do it.
Jer 26:3 Perhaps everyone will listen and turn from his evil way, that I may relent concerning the calamity which I purpose to bring on them because of the evil of their doings.’
Exo 33:14 And he said, “My presence will go with you, and I will give you rest.”
Exo 33:15 And he said to him, “If your presence will not go with me, do not bring us up from here.
Exo 33:16 For how shall it be known that I have found favor in your sight, I and your people? Is it not in your going with us, so that we are distinct, I and your people, from every other people on the face of the earth?”
Exo 33:17 And the LORD said to Moses, “This very thing that you have spoken I will do, for you have found favor in my sight, and I know you by name.”
Eze 4:12 And you shall eat it as barley cakes; and bake it using fuel of human waste in their sight.”
Eze 4:13 Then the LORD said, “So shall the children of Israel eat their defiled bread among the Gentiles, where I will drive them.”
Eze 4:14 So I said, “Ah, Lord GOD! Indeed I have never defiled myself from my youth till now; I have never eaten what died of itself or was torn by beasts, nor has abominable flesh ever come into my mouth.”
Eze 4:15 Then He said to me, “See, I am giving you cow dung instead of human waste, and you shall prepare your bread over it.”
This is a huge theme in the Bible. I 1 Samuel, God changes His mind about Eli’s family priesthood after seeing the actions of Eli’s sons. In Jonah, God changes His mind about destroying Nineveh after seeing the people repent. In Jeremiah, God offers to change His mind about destroying Israel if the people repent. In Exodus, God changes His mind about accompanying Israel after Moses insists. In Ezekiel, God changes His mind about his prophet eating food cooked with human poop after the prophet objects.
Nowhere is there a concept of exhaustive definite foreknowledge (EDF). Instead, God reacts and changes His mind on a host of various issues at different scales. The largest scale repentance is God regretting that He made man:
Gen 6:5 And GOD saw that the wickedness of man was great in the earth, and that every imagination of the thoughts of his heart was only evil continually.
Gen 6:6 And it repented the LORD that he had made man on the earth, and it grieved him at his heart.
Gen 6:7 And the LORD said, I will destroy man whom I have created from the face of the earth; both man, and beast, and the creeping thing, and the fowls of the air; for it repenteth me that I have made them.
See also: God responds to rejection