**Say, "I hold not for myself [the power of] benefit or harm, except what Allah has willed.
And if I knew the unseen, I could have acquired much good, and no harm would have touched me.
I am not except a warner and a bringer of good tidings to a people who believe."**
[Qur’ān 7:188]
Ibn Kathīr writes in his Tafsir, regarding this Verse, that Allāh has Commanded His Messenger (sallallaahu 'alayhi wa sallam) to inform the people that he does not have knowledge of the unseen except as much as Allah has given him.
Imam Al-Qurtubi writes in his Tafsīr regarding the portion of the Verse which reads “And if I knew of the unseen I could have acquired much good…” that the meaning is that had I known what Allah wants me to do, I would have done it before He informed me of it.
As for the part which reads “Say I hold not for myself [the power of] benefit or harm…” it means that I cannot bring good to myself and nor can I repell evil from myself so then how can I know when the Hour will be established.
Had the Messenger of Allah (sallallaahu 'alayhi wa sallam) had knowledge of the Unseen, no harm could have ever touched him as he would have saved himself from it prior to it reaching him.
Only Allah has complete knowledge of the Unseen. He is 'allaamul ghuyoob - The Knower of the Unseen.
Source(s):