If you "bite your tongue" it means you want to say something, but you know what you say will not make your listeners happy, so you don't say it.
If you "put your foot in your mouth" you say something unfortunate by accident. For example, you talk about how much you dislike someone, only to find out that the person you're talking to is that disliked person's wife.
So you may realize that you've "just put your foot in your mouth" for your meaning.
If you give a full example, we may come up with something better.