Not sure about a solution since I haven’t come across this scenario. However if replacing the project file as @rmunro mentioned works then it’s a good way to proceed. Dependencies is not going to be a problem because you can manually edit the code of the project file after replacing and add all the dependencies code which was the previously…
So replacing the file and adding the dependencies manually should work as intended…