That's kind of stupid. There's a little thing called the Treaty of Paris signed in 1783 that settled the ownership of the Northwest territories. That was followed by the Treaty of London signed in 1794 that tied up all the loose ends and which is why Detroit belongs to the U.S. Though we might wish some times that it did not.
So what legal proceeding transferred ownership of Sumter to South Carolina?
Independence.
Why would we wish for Detroit to not belong to the United States? It has the highest percentage black population of our major cities.