Instead of Committing Files, I hit 'Sync' in GitHub app

谁都会走 提交于 2019-12-25 04:22:59

问题


Which Git then proceeded to sync (overwrite) files from my repository (not github), to my local files. I have lost an entire day or more of work.

Is there a way to revert what happened? What did happen? I am side myself.

Rich


回答1:


If the application stashed the changes instead of removing them you will be able to restore it. Try this:

git stash list

Hopefully you'll get an output stash@{0}: ..., which should be easily restored with:

git stash apply

However if there is more than one stash you'll need to call:

git stash apply stash@{number}

If it's more complicated, look into docs for stashing.

Note that if there's no stash, the uncommited changes are gone. Forever. If you don't have an editor that preserves changes or has some backups then I don't think there's anything you can do.



来源:https://stackoverflow.com/questions/40052451/instead-of-committing-files-i-hit-sync-in-github-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!