The Lord saw that the wickedness of man was great in the earth, and that every intention of the thoughts of his heart was only evil continually. And the Lord regretted that he had made man on the earth, and it grieved him to his heart. -Gen 6:5-6

There are many passages in the bible where God seems to change his mind about things, where he does something and is documented as "regretting" it.

How is that possible if God truly is omniscient about the past, the present and especially the future?

Lets digress for a second and consider this fact; in the Bible, there is a lot of simplification for easier digestion of content. The most famous simplification is God's repeated assertion that he is One, which later in the new testament, we learn he is both one God and also three (Father, Son and Holy Spirit). There is also the countless times when the count of the number of Israelis is a nice round number, which, if we are being precise, is really not accurate at all. While this is not a lie, its most definitely designed so that people can easily comprehend the stories told. While it might not be important to have an exact count of how many Israelis left Egypt, the element of the story that is important is that they were in the millions.

So, much like that, when the story of the Bible is told, and even when God communicates with people, concepts that we are already familiar with are used. When God spoke to people in the Old Testament, he used Hebrew but when he spoke to those in the New Testament, he used Greek. It is not that he moved to the best language as it came, but rather he wanted to be understood by the listeners.

When the Bible says "God regretted", what it means is that it was no longer possible for God to overlook something. When I have an exam in a month, I don't get nervous now, I get nervous when I am sitting in the exam itself.

Even though God knew from the very beginning that the day would come when he would no longer be able to overlook the things that were taking place on Earth, it was only on that day itself that his patience ended.