Genesis 6:5,6: (KJV) 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. 6 And it repented the Lord that he had made man on the earth, and it grieved him at his heart.

The word “repent” means “to change the mind or course of conduct on account of regret or dissatisfaction with what has occurred.” The question then is, did God change His mind (plan) or His course of conduct? Knowing the end from the beginning, God’s mind could not be changed, so “repent” in this text must signify a change of conduct. That is, God did change His course of dealing with man because of man’s wickedness that grieved Him, but He did not change His mind or plans, because these plans had from the very first recognized the corrupting and degrading tendency of sin and provided (in purpose of mind) the Lamb of God – “slain from the foundation of the world” – as the redemption price. (Revelation 13:8, Revelation 17:8) 

God was very much grieved and displeased by man’s rapid progress in wickedness; that, instead of loathing his sinful condition and looking to God for relief, he took pleasure in still further degrading himself. God, according to His original purpose, changed the course of his dealings and ended that age by blotting out of existence for a time those who were so unworthy, that their gross depravity should not interfere in the further development of his plan. 

Additional Resources:
A similar question along these lines was asked and answered here: 
In Exodus 32:14, God said He repented when He was going to destroy Israel. If God knows all things, why does He change His mind and repent?  

The same question arises in the context of Israel demanding a king, and God allow King Saul to reign: 
Audio Sermon: “Nay, But We Will Have a King,” Joe Megacz