“Samuel says in 1 Samuel 15:29 that the ‘Glory of Israel will not lie or repent; for he is not a man, that he should repent.’ I take this to mean that the repenting which God does (for example, in v. 11 [of 1 Samuel 15]) is not like the repenting man does.
In fact, it is so different that in one sense it is not repenting at all, as verse 29 says. It is not based on ignorance or deceit. The repenting of God is the turning of his heart in a new direction but not one that was unforeseen. God does not repent because he is caught off guard by some turn of events. That would indeed be like man.
But the Glory of Israel is not a man that he should repent. When the Bible says that God repents, it means that he expresses a different attitude about something than he expressed before, not because any turn of events was unexpected, but because the turn of events makes it fitting to express a different attitude now because of a change of circumstances.
-John Piper, The Pleasures of God: Meditations on God’s Delight in Being God, 224.