Project files get corrupted

After trying to reverse to a previous version my flow is not loading anymore and I got an error: "you need to resolve your current index first".

I could see the flow.json file in the project folder. When I try to import the flow file directly in node red I got another error as the file is mixing 2 version of the flow.

I am kind of stuck and some help will be greatly appreciated. This flow is rather complex and it controls my home heating system with the outside temperature getting close to 0°C...

I was able to regenerate the flow with a backup so my heating system is back online. But I am still interested to understand how to fix a corrupted project as well as the proper way to reverse to a previously committed version.