1
I was about to back up my local work to github today (1,100 commits). Not sure what I did but all of a sudden it says no commits, and all my Xcode files are now red. It seems to have synced my local files with the github files deleting everything locally. Is there anything I can do!?!?
It's 2 months of work :(
Update:
git reflog
shows the following:
8ad5e45 HEAD@{18}: commit: UI/UX Improvements for Sign Up Process
5c2d47f HEAD@{19}: checkout: moving from myBranch to master
5c2d47f HEAD@{20}: checkout: moving from master to myBranch
5c2d47f HEAD@{21}: checkout: moving from myBranch to master
5c2d47f HEAD@{22}: checkout: moving from master to myBranch
UI/UX Improvements for Sign Up Process
was a pull request I submitted back in November. So I think what cleared my local files was accidentally tapping the "branch tab on my github desktop app and switching it. I switched back to see if it would undo it but nothing changed.
Commit daily! That's the point of Github! Make it automated! Are you sure the files are nowhere to be found on your desktop? Check the
Event Viewer
and see if there's any trace of you removing the files. Check everywhere. EVERYWHERE. – Dandy – 2016-01-26T00:10:35.333What does
git reflog
show? – David Schwartz – 2016-01-26T00:22:02.417Hi @DavidSchwartz I just updated my answer with the result. – KingPolygon – 2016-01-26T00:25:51.527
@AaronLayfield Where's the
Event Viewer
? – KingPolygon – 2016-01-26T00:31:32.1931@AaronLayfield source control should not serve as the (main) backup method. Committing itself does not help you (OP states they lost 1100 commits), and pushing to a remote (e.g. GitHub) is not the same as doing a backup, either. – Stijn – 2016-01-26T00:38:07.407
@Stijn It can be if you're working from your own fork/repository. Of course its not the main backup method, but its better then losing 1,100 commits. Edit: Realised I said 'That's the point of Github', but I can't edit that comment anymore and that's definitely not what I meant, sorry. – Dandy – 2016-01-26T00:42:00.363
What happens when you do stuff like
git log HEAD@{1}
? – David Schwartz – 2016-01-26T05:20:34.287Hey David, it returns a push done back in November. – KingPolygon – 2016-01-26T06:16:54.940
:( That's not looking good. – David Schwartz – 2016-01-26T08:49:32.873
Yeah :/ Honestly I've learned my lesson. I'm just gonna take the L and try to redo as much as I can. I'm sure it'll end up better than before. – KingPolygon – 2016-01-26T09:11:23.610