Ha ha! You're an idiot!
I have done this exact thing when I had to replace my battery and took the old one to swap out for core exchange while my X5 sat at home. Climb in and crawl into the cargo area. There is an emergency release tab in the upper hatch. It's a small square or rectangular piece of plastic you have to pop out. Pull the tab and you're back in business.