The governor's bill to restructure the top leadership at the MTA has been revived in Albany.

The last-minute deal-making comes one day after Gov. Andrew Cuomo’s plan was left for dead when the state Senate refused to schedule it for a vote.

Cuomo and lawmakers were able to cut a new deal because, due to a technical error, the Legislature suddenly needs the governor’s assistance passing a criminal justice reform bill before the legislative session ends this week.

Under the original MTA legislation, Cuomo wanted to split the roles of MTA board chair and CEO.

Pat Foye currently holds both titles, but he is departing at the end of July to head up Empire State Development.

The governor was looking to appoint interim New York City Transit President Sarah Feinberg as board chair, who would be subject to Senate confirmation, and Janno Lieber as CEO, who would serve at the pleasure of the governor and would not require Senate confirmation.

But that deal was rejected by the Senate Wednesday because lawmakers wanted more accountability for the MTA. The MTA oversees the metropolitan region’s public transit, including the city’s subway system.

Under the revised deal, the two positions would still be split, but the CEO would now also be subject to Senate confirmation. Sources say the Senate will reconvene before the end of the month to confirm both nominees.

The Legislature was willing to make the deal with Cuomo because a criminal justice reform bill known as “Clean Slate” had to be laid aside due to numerous technical drafting errors. The Clean Slate bill would seal criminal records after a set period of time, allowing those previously convicted to have better access to housing and jobs.

A new version of Clean Slate would normally require the three-day aging process for all bills before they can be voted on, unless Cuomo issues what is known as a “message of necessity,” which allows the bill to go live and get voted on right away.

Cuomo plans to issue messages of necessity for both his MTA bill and Clean Slate, allowing legislators to vote right away and wrap up the legislative session early Friday morning as planned.