问题
I just tried to do the dutiful thing and backup my work to github, since I had not done a commit in a few weeks due to working on a large work area.
Github for windows notified me it needed to download the latest update and it did so.
I opened the repo, then did a commit.
When I hit sync, it deleted all 138 new files from disk and reset to the last commit more than a month ago. It also overwrote all existing files that were modified with the old version.
I have no backup... this was meant to be the fscking backup.
Is there some magic git command to undo this shitstorm, or will I need to try recover the new files with a file undelete tool ?
git reflog output: 40847ec HEAD@{0}: pull --progress --prune: Fast-forward 913f45e HEAD@{1}: rebase: updating HEAD 02c93d0 HEAD@{2}: rebase: aborting 02c93d0 HEAD@{3}: commit: <-- last good commit
Please help!
回答1:
Try to invoke git reflog
. It should show you the list of recent commits. The you may use git branch MyHappyBackUp <sha1>
where <sha1>
is one of those commits from git reflog
. If you don't have "plain git" installed, try this build
回答2:
OK, it is 2 hours later, I just loaded github for windows (again), and my commit is magically there.... still not sync'd though.
WTF ? Are large commits done asynchronously and then the GUI does not know about them till they are finished or something ?
来源:https://stackoverflow.com/questions/23026067/github-for-windows-just-deleted-all-my-files