Search code examples
githubgithub-for-mac

How to undo the sync to get the files in local repo back?


I'm very new to github and I started using it a few weeks ago for my uni group project.

The problem that I'm having is: There is a remote repo on github where everyone in the group is using. I do have a local repo on my laptop, where I've worked my part of the project. I recently committed and synced the updates that I made to github using desktop app for mac. I got a few errors and the sync failed. After that when I looked at the files that I have locally, they got overwritten by the ones from the git(non-updated version) and all of my work are gone.

Can you please help me on what I should do to receive the files that I had locally? Is there any way that I can undo that last sync. I found a few suggestions online, but since I'm not sure which one to use, I don't really want to mess up the files anymore.

Thanks


Solution

  • (Nearly) All changes made to git repositories can be undo. We don't know the commands you entered but enter it at Google for a specific solution.

    You proberly have to use something like:

    $git rebase