In this case, I think you should start the project from the .ioc file in this case.
Also, I may suggest you regenerate the project from CubeMX with IDE as a toolchain and unchecking the "Generate under root". This way any user code in the main.c will be kept (not sure about other files added by users).
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.