Bruce Ware writes:
Perhaps the situation is a bit like a father who decides to surprise his teenage son with an outing to see his favorite baseball team play an early-evening game. His son has been hard at work since early morning preparing their garden for planting and getting their lawn in shape, and by this point in the day, he is obviously very tired and ready for some rest. As the father approaches his weary son, he grabs a few lawn tools from the garage and says with enthusiasm, "I thought I would join you back here so we could get in three or four more hours of good work!" Upon hearing this, the son responds by telling his dad that, although he's pretty worn out and hungry from laboring so hard, he'd be happy to keep on working for a few more hours, if this is what his father wants. In response, the father looks back at his son, and with a smile says, "How about instead you and I head for the baseball stadium? We'll catch the evening game and get some hot dogs and peanuts as soon as we get to the park!" The much relieved and deeply grateful son thanks his dad and the two of them get ready to head to the game. The father clearly has "changed" what he had just stated that he and his son would do. Instead of staying home and working together in the yard, they go to the game. Yet inwardly the father's intention from the outset was to take his hardworking son to the game. The manner in which he accomplished this goal, however, involved his son's willing response to continue working as part of the background for announcing his real intention of taking his son to the game. So, in the narrow sense, the father changed course from his stated intention. But in the broad sense, he fulfilled exactly what he had secretly intended all along. But notice: The father only fulfilled this broad intention in the way that he chose by involving his son and through the response of his son (from antithesis.com).
How, then, are we to understand this issue?
From the perspective of the human author of Scripture, the events surrounding an apparent change of God is best recorded in terms that represent adjustment on his part. This is known as a figure of speech called "anthropomorphism." At no time, however, does God's essential nature change, nor is God's knowledge revised based upon conditions and events that "catch him off guard."
God never learns and always knows all things actual and possible, past, present, and future. In some cases, God does not state his full intention when speaking through the biblical author. God knows everything there is to know and he is never "uninformed" or "further enlightened" by human choices and events.
When God is said to "repent" or "relent" it indicates (1) that he is aware of a human situation that has been altered and (2) a desire to act in a way that is perfectly consistent with his character (merciful/just).
To consider ...
God consistently deals with people on the basis of his changeless character and people's responsible moral choices, which he omnisciently included in his eternal plan. In the short scheme of things it appears God is reacting to his creation. But, in the long run, nothing falls outside the divine blueprint. God has some built-in contingencies in his sovereign plan which he is in complete control over all of the time. For example, God's declarations of judgment would come true provided situations remain the same (Ex. 32:9-14; Is. 38:1-6; comp. Jonah 3:4 with Jonah 3:10). However, it is people who change, not God. His purposes, plans, and promises will stand forever. As truly sovereign, he ordains the means as well as the ends. Moreover, God is not bound to use the same strategy to accomplish his purposes. Some things God permits, while other things he directly performs. This is not to say that if God had it to do all over again, he would do things differently. Only, God brings about some of his good purposes conditionally or indirectly, while others he unconditionally or directly accomplishes.