2013 850 Touring Check Engine Light On after rollover

I had a ramp fail offloading my 2013 850 Touring as I was coming out of the pickup truck. I was offloading with a steep slope on my right side. Yes I know this was stupid!!. And I was using cheep ramps. I now own a really good set of ramps!!! You have not lived until you are laying on the ground seeing a 800lb bike coming at you. I gave it a push as it was about to land on me and the bike went end over end down a 75 ft hill. I brushed myself off with no broken bones and could here it running on it’s side at the bottom of the hill. I scurried down the hill and shut off the bike. After wiping off the blood from numerous scrapes and cuts I rolled the bike upright with the help of a couple of guys. Checked the oil and gave it the once-over. Handlebars bent lots of plastic cracks, front and rear racks ruined etc etc. Fired up the bike as I needed to move it to a location I could winch out of the bottom of the ravine. Check engine light was on. I figured it was a rollover sensor as all fluids were good. Loaded up and headed home. Ordered a bunch of parts and took the bike apart. Disconnected the battery and the next morning hooked it back up to find check engine light still on. Bike ran fine. All the internet and forum search indicated a trip to the dealer to have them use their fancy diagnostic tool to reset the computer. Not happy about that but decided to disconnect the battery while waiting for the parts to come. Two weeks went by with the battery disconnected. Installed all the new parts changed all the fluids and did my annual maintenance and reconnected the battery as the last step. Check engine light was out and has stayed out ever since. If you ever roll over the check engine light will come on but in my case disconnecting the battery for a long period of time worked. What did not work was an overnight disconnect. Hope this helps someone.