Here are a few quick things that may help. First, he does have to serve you with the papers (if it's just against you). Second, it seems that he may have sought and obtained a temporary "restraining order" (this is actually a category of such orders, but I'll spare you the legal technicalities for now). Otherwise, you would have had the chance to appear and defend yourself in court.
A temporary restraining order ("TRO") is generally valid for only 14 days (although it can be renewed with a new order), and can be obtained without your presence at court. Make sure to follow the order. But there's usually a hearing scheduled 2 weeks after the temporary order for a longer term restraining order (since the TRO expires pretty quickly). Once served with the TRO, you'll have to opportunity to respond (both in writing and by appearing at the hearing) before a judge or commissioner (essentially a court-appointed judge). It's there that you can make the argument that the TRO shouldn't become a longer term order.
If what you say is true, then I imagine you'll prevail. But when you present a written response (and I suggest you do), make sure to respond to *each* of his written allegations, and make sure to include *all* evidence that supports your position (like printing out harmless text messages between you and his girlfriend).
Also, you leaving messes that he cleans up (and other inconveniences) aren't generally grounds for a restraining order. He'll have to show some level of harassment, reasonable fear for his safety, or something else along those lines. Essentially, he has to show threatening/harassing behavior and that he feels reasonably threatened and harassed.
Anyway, good luck and I hope this helped.