I was speaking with someone and I accidentally said leave it to the gods (plural) I immediately regretted and corrected myself and said leave it to god (singular)and I also said Astagfirullah after. Have I associated partners with Allah and committed shirk.
You didn't commit shirk, since it was an accident, and Allah was watching you.
Say, "O My servants who have transgressed against themselves [by sinning], do not despair of the mercy of Allah. Indeed, Allah forgives all sins. Indeed, it is He who is merciful and forgiving. Quran 39:53
If someone commits shirk intentionally, then he will be held accountable for his sin, but if someone shirks inadvertently, then he must mend his word and repent. As a result, since you did not do it intentionally, you did not sin. And Allah only knows your intentions.