The adverb inadvertently means something done accidentally.
Synonyms are carelessly, negligently, recklessly, or unintentionally.
The word origins from 16th century. It comes from inadvertent meaning “careless, accidental”.
He rushed into a decision inadvertently that almost took the king’s life.
They inadvertently met in the busy streets of Shibuya.
She’s not aware that she inadvertently rescued him from living a meaningless life.