One day, a thought came to my mind that I should not say something about a Hindu god, because what if they exist. But after that I start to thinking: what I'm thinking? At that time, I don't perform namaz and don't do any thinking which will make my Emaan strong. But now I do perform namaz and do all kind of nafal Ebaadat which can make my Emaan stronger. And I never believed in other God but Allah. But by thinking that, have I committed shirk?
As soon as you realize, you must seek forgiveness as this ayah says:
And if there comes to you from Satan an evil suggestion, then seek refuge in Allah . Indeed, He is the Hearing, the Knowing. (41:36)
InshaAllah it will be forgiven as sudden evil thoughts are forgiven as long as you never believe the thoughts or act upon them as this hadith states:
"Allah has forgiven my followers the evil thoughts that occur to their minds, as long as such thoughts are not put into action or uttered." (Bukhari)