The only reasonably safe way to walk away from this to a likely competitor is to have your previous company sign an agreement wherein they consent to the situation. That way if they try to sue you later you can show that it was all above board. Sounds like they're going to want some or all of your shares in exchange for that agreement.
You need a lawyer to be safe, otherwise you will probably end up settling for a part of whatever you create at the new company.
Not a lawyer.