We have three senior developers collaborating on the same app via Git integration. You have to be VERY careful with sync operations, and the "safe merge" often messes up your project bringing it back to an earlier point. Despite all of this we have been able to build the app and have worked around these issues.
When there are significant issues from the buggy Git integration we have to roll back by setting the master branch HEAD back to a certain point (a force operation). This dumps all of the commits that came after the commit that the repo was restored to. You still lose changes but it is not as bad.
Well, one of the PowerApp smart merges nuked a bunch of changes and one of our devs reset the head of the repo to the wrong commit and we lost weeks of work.
I turn to the versioning that still works during Git integration, and I can see that we have the app as it was before the fateful git rollback. I restore, and before editing the app I publish and play it...verifying that it is the desired version of the app.
However, if I open the app for editing it pulls from the repo when it loads. After restoring, the restored version is still on Git and hits the repo and pulls down the bad code, when opened for editing. I tried disconnecting Git before restoring...the restored app's setting take affect as you would expect--pulling from the repo as I mentioned--overwriting the code that was just restored. Catch 22.
I need to load a previous version and disable git integration before loading it. I tried an export but the app is stored as a binary data file in that case (.msapp file). So no hacking my way to victory there.
I have tried deleting the repo and opening the app. It fails with no recourse. I tried creating an empty repo of the same name, it fails with no recourse (there is no empty directory and it will not create one, you cannot push an empty directory to a git repo).
Is there a way get the code from a previous version of the app in this case?