web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to quit Git integr...
Power Apps
Answered

How to quit Git integration and restore a previous version

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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?

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I'm currently using the advice in this post to unpack a previous version and manually restore files to the git repo. 

    Power Apps: source code edit for Canvas Apps in Visual Studio Code (microsoft.com)

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    When you activate git versioning, you will manage the source cords yourself. If you want to get an older version, you should go through your commits to find the correct version and restore that version.

     

    If you want to stop the git integration, open the app in edit mode and, go to file and select save as. This will basically create a new app that has the source code hosted on the power platform again.

     

    That’s how I returned to the normal way of working after some sync issues.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Manually updating the repo has gotten me out of the data loss pickle. Where would you make modifications in the code to disable git integration manually?

     

    SeanAnderson1_0-1660750809083.png

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    good step Sean!

     

    You have to understand that when you switched to git source control, that you basically said that you don’t want the Power Platform to store the content of your app (the code that specifies all your controls and functions), but you will store it in your git repo.

     

    That’s why you have to tell Power Platform to switch back to storing it in Power Platform, so no git repo anymore.

     

    When I wanted to do it I could not find anything from the documentation (few months ago), but saving as in the could got the source code back in Power Platform. 

     

    If you want to keep the original app, you can open the newly saved app, and again do a save as and select the original app.

     

    I would copy the source code to your hard drive first so you can go back again if something fails.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Lesson learned...if you are using git integration in its preview form, you should be exporting your project periodically. You can unpack the msapp file with the Power Platform CLI Visual Studio Code extension and push the files (screens/components/etc) from that into your git repo manually if you need to. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Good job experimenting with the new feature. Good luck!

  • Supercato Profile Picture
    10 on at

    Maybe this is old, but yesterday have the same problem, the way that I found is EXport the solution and reimport again, github was gone!

    cheers

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 833

#2
Valantis Profile Picture

Valantis 563

#3
Haque Profile Picture

Haque 383

Last 30 days Overall leaderboard