Despite what my contract says, if my employer asks for my personal projects, I'm quitting the same minute and we can work out the remaining details over email. I guess if they push and threaten enough I will eventually hand over the code.
But in such a scenario, I'm not a loser. If I'm capable of writing software that my former company cares that much about, I'm winning. I'll hand over my Haskell code, laugh at the thought of them trying to understand it, purge all copies I posses, and immediately begin rewriting it in another language and under another anonymous profile.
Making it one-step harder for lawyers is generally all it takes.
Don't draw lines from your GitHub account that you use at work to the GitHub account that holds your side projects.
Every time I start with a new company, I spin up a new GitHub account just for that company.
Sorry this happened to you.