Sorry but it is the case that one Parliament can simply undo any statute by passing a further Act of Parliament. In legal terms, there is no such thing as 'entrenchment' in UK legislation; all laws are equally easy to repeal. This has a good side and a bad side. It does mean that any bad laws can be struck out in the future by a simple majority; but it also means that no rights or guarantees laid down in statute can be guaranteed. So for instance, although the people of Gibraltar or Northern Ireland have been told they will always be part of the United Kingdom, there is absolutely nothing to prevent a future government reneging on that. The same for ID cards, nuclear power stations, Blue Streak or aircraft carriers.
This is different from say the American system where the Constitution has greater legal weight than any other law and can only be amended, and even then only by a protracted process involving the state legislatures as well as Congress.
The Tories could simply introduce a bill called 'The Identity Cards Act, Repeal Bill' which stipulated that the previous act was no longer on the statute books and laid out a process for ending its terms. Once it had passed through Parliament and obtained Royal Assent (a formality actually performed by the Speaker), the Identity Cards Act would be nothing more than a legal curiosity.
As for long term projects being cancelled on the whim of a government, you just have to look back to the 1960s to see how new governments took great pleasure in cancelling ongoing projects favoured by the previous administration. Any project can be cancelled at any time; although penalties *may* be due on cancellation.
In practice bills that repeal legislation are quite rare since Parliamentary time is limited and governments much prefer to add new legislation to the books than get rid of old stuff.