UK can unilaterally reverse Brexit, EU's top court told