I woke up with my iphone telling me to plug it into itunes. I did, and it started to update and restore the software, which failed.
Afterwards, the phone still didn’t boot past the “plug into itunes” screen, but itunes wouldn’t recognize it to try to restore again.
After a lot of digging, I found how to force the phone into “Recovery Mode” again: as you turn it on, hold the top and home buttons. After the connect to itunes screen appears, release the top button but keep holding the home button. This will make re-register itself as an apple recovery mode device.
After that, the restore still failed, so I shift-clicked restore and selected a fresh .ipsw I downloaded online. That also failed with error code 1015. I did it one more time from apple, and it worked, but then it consistently booted into recovery mode.
This guide: http://www.ihackintosh.com/2009/07/irecovery-iphone-recovery-mode-loop-restart/ sorted that out. Nice usb utility too.