Sure, North Carolina’s 2013 tax reform debate took a number of twists and turns. But at least no one in the Tar Heel State suggested passing a law designed to help people pretend that a previous tax decision never happened.

It’s unfortunate that Iowans faced that bizarre set of circumstances.

For six years, the state has collected more than $20 million for a tax that didn’t exist.

When questioned about it, the Legislature adopted the solution preferred by small children who’ve done something wrong — they pretended it never happened.

In 2008, the Legislature passed a bill that accidentally included language repealing the section of the tax code that imposed a sales tax on heavy machinery purchased in the state. No one noticed until last summer, when a lawyer contacted the Iowa Department of Revenue seeking clarification about the tax.

Faced with the possibility of having to refund more than $20 million collected for a nonexistent tax, not to mention losing an estimated $7 million in taxes a year going forward, lawmakers passed a bill Thursday reinstating the tax and making it retroactive to the date of its accidental repeal.

The governor is expected to sign it.