The exact same thing just happened on my wife's car a couple weeks ago. In my case the top was new in 2015, but came from another car and I was not the original buyer. For now I have the hard top on.
I intend to take it to a local auto glass shop and see if they have a good adhesive to reattach it. Otherwise, I'm going to clean it and try 1/2" 3M Automotive Trim Tape:
https://www.3m.com/3M/en_US/p/d/b40069527/