bite your tongue/lip - definition and synonyms

phrase
  1. to stop yourself from saying something that might upset or annoy someone

    I almost told her what I thought of her, but I bit my tongue.

See also main entry: bite