There is a way to do this. We had the same issue when 500k contacts ownership got changed.
I would contact Marketo Support immediately. I could outline the steps we took, but it would be better to get it from them, so that you're supported if the fix does not go as expected.
One thing to know, contacts owned by inactive SFDC users cannot be changed back. This might not be an issue for you, but it is good to know.
As for what caused this, I'd look back at any Smart Campaign that involves changes in ownership. In our case we only wanted the change of ownership to impact a very small subsection of data, based on some historic behavior. That was fine, but I put an "or" where I needed an "and," and that was all she wrote.
One step to mitigate potential errors like this is to put a limit on the number of records a Smart Campaign can execute.