There's a huge detailed post on the battery removal process here uploaded to YoutTube by Jay Sommet, but the most important part is this:

Safety first!

To make the battery less dangerous, I did two separate procedures before removing it. First, I pulled up the service disconnect panel (between the rear passengers foot wells), unscrewed the 10mm bolts holding the metal cover down, and pulled the service disconnect from the middle of the battery. This splits the battery into two ~200 volt halves, instead of a single 400 volt whole. It also opens the circuit to the high voltage cable connections.

To remove it, you have to lift the back slightly (rotating it up), press in a catch, and then finish lifting and rotating to a vertical position, after which you can pull it out. I wore my 500 volt gloves for this procedure.

Note: The inverter portion of the motor unit has capacitors in it that take a full 10 minutes to self discharge. So after you pull the service disconnect, wait at least 10 minutes before doing any work on the orange cables!

I also removed the connections to the 12 volt accessory battery. This prevents the contractor in the battery from accidentally connecting, hopefully keeping the high voltage terminals from being energized. (However, when removing the connectors and covering with electrical tape, I still wore my 500 volt gloves…)

We don't advise that you attempt a DIY battery removal, but it sure is interesting to see the process.

Again, we strongly suggest you check out the detailed battery removal post here.