How to reset phone that can't boot (preferably keeping data)

A

AC Question

I tried to install Lollipop on my Motorola XT1039 but it when it restarted, it took me to the TeamWin menu and wouldn't install. When i booted normally from there, it would force restart after a minute to try and install Lollipop again. On around the fourth time, I tried to "Fix Permissions" in TeamWin hoping that would let me install Lollipop. Now, the phone boots, I see the Motorola animation, but then the screen turns black, with backlight, but is completely unresponsive. The only thing I can do is long hold restart, meaning I can't even turn the phone off. When I connect to my PC it makes the sound of a device connected, but doesn't show up, so I can't access it. How can I reset the phone?