afaik, british control derived from a land lease. the lease ended per the time table in the lease. as such nobody was 'kicked out'.
And so, for better or for worse, they came to an agreement in the Sino-British Joint Declaration. The British were essentially "consensually kicked out" (as the Brits might say, "mustn't make a fuss" ;) )
Deng actually told Thatcher that if britain didn't leave, china would invade HK and unify by force. Thatcher actually asked the US if they would protect britain from china and we said no. And that was the end of britain's hope of keeping stolen territory.