To act in a way that is contrary to what is appropriate, advisable, or effective; to make an error by doing the opposite of the correct or expected course of action.
2.
United StatesUnited Kingdomfigurativecolloquial
To behave unpredictably or contrarily at a time when conformity or the opposite action would be more sensible or advantageous.