The Liberal Democrats have pledged to cancel Brexit if they come to power at the next general election.