If you get hit, stay strong - keep it classy. Walk out with your head held high.
You have skills - you should be okay.
Leave on a good note and ask your manager if you can use them as a reference.
Regardless of what we have to put up with from upper management, it has been an honor and a privilege to work with many of you.