GitHub for Mac Commit & Sync has overwritten local files. How can i return

I used "Commit and Sync" and for a short time the "Merge Conflics" dialog appeared like VonC described here. Then all my local files were overwritten. But there is an entry in history, and also if I rungit reflog show

How can I get this sync back and get my updated local files back?

Any ideas?

+3


source to share


2 answers


Your changes will probably be hidden ( git stash

). For some reason, Github on Mac lags behind any local changes, so it can flush changes from the remote repo (although it's misleading that it didn't do anything because it was overwriting changes).

WARNING: I will back up your directory before trying any of the following if something goes wrong.



Open a terminal in your repo directory and enter git stash list

. You should see an entry like stash@{0}: GitHub: Stashing to pull in remote changes

. If you type git stash show stash@{0}

, it will display a list of files with all the changes you had before.

To restore those changes, push git stash apply stash@{0}

and write those changes to your directory (perhaps overwriting the changes you pulled from the remote repo). You can also use git stash pop @stash{0}

to get the code and remove the stash right after that, but I would stick with it until you are sure you don't need it.

+1


source


I found the original files in Stashes and restored them



0


source







All Articles