By mistake is used to describe something in error; accidentally.
1. I grabbed the wrong pant size by mistake, could you find the next size up?
2. I took the exit by mistake and now we’re lost.
3. I’m sorry, I think I dialled your number by mistake.
4. An mysterious text was sent to me by mistake.
accidentally, as luck would have it, by a fluke, by coincidence, for some reason, fortuitously, haphazardly, unexpectedly, unintentionally, unwittingly