587. That 'Jehovah repented that He had made man on the earth' means mercy, and that 'He was grieved in heart' has a similar meaning, is clear from the consideration that Jehovah foresees from eternity every single thing and therefore never repents. When He made man, that is, created him anew and perfected him to the point of his becoming celestial, He also foresaw that in the process of time he would become the kind of person described here. And because He foresaw the kind of person he would become, He could not repent. This is quite clear in Samuel,
Samuel said, The Invincible One of Israel does not lie, and He will not repent, for He is not a man (homo) that He should repent. 1 Sam 15:29.
And in Moses,
God is not a man (vir), that He should lie, or a son of man, that He should repent. Has He said, and will He not act? Or has He spoken, and will He not carry it out? Num 23:19.
'Repenting' however means having mercy.
 Jehovah's, that is, the Lord's mercy includes every single thing which the Lord does towards the human race, whose condition is such that He has mercy on it, on each according to his state. He has mercy therefore on the state of the person He allows to be punished, as He does on that of the person on whom He confers the enjoyment of good. Being punished is a manifestation of mercy because it turns all evil that is being punished towards good. And conferring the enjoyment of good is a manifestation of mercy too, because nobody merits anything good at all. In fact the whole human race is evil, with everyone, if left to himself, rushing into hell. Consequently it is by mercy that anyone is rescued from that place, and by nothing other than mercy, since the Lord does not need anyone to help Him. The word mercy (misericordia) is used therefore because mercy rescues a person from misery (miseriae) and from hell, and so is used with respect to the human race whose condition is such, and it is the product of love towards all because all are such.