2

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!

Richard
  • 948
  • 2
  • 11
  • 16

2 Answers2

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

user3159253
  • 16,836
  • 3
  • 30
  • 56
  • I haven't dealt with the "github for Windows", and always thought that github is only the hosting for git repos and projects, but I'm sure it's just a shell for plain [old] git for Windows, so you may use it w/o any shell. – user3159253 Apr 12 '14 at 04:35
  • 1
    The only output of 'git reflog' is: 40847ec HEAD@{0}: pull --progress --prune: Fast-forward 913f45e HEAD@{1}: rebase: updating HEAD 02c93d0 HEAD@{2}: rebase: aborting ....then the previous commits.... There are no local branches other than 'master' – Richard Apr 12 '14 at 04:39
0

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 ?

Richard
  • 948
  • 2
  • 11
  • 16