Ryan
Ryan

Reputation: 640

Local files deleted after sync before commit

I'm just getting my feet wet with git/github. Please bear with me.

I spent about 2 hours working on a set of files for a gh-pages repository. I edited some existing files and created some new ones during that time.

When I opened github for mac, I saw that there were 14 uncommitted changes. Foolishly, I clicked the 'sync' button before committing and the edits to my local files vanished.

Is there a way to retrieve them or is all that work lost?

I tried this without success.

$ git reflog
a2bbe73 HEAD@{0}: revert: Revert "updates"
eaa3f6a HEAD@{1}: commit: updates
b4dba1f HEAD@{2}: commit: configuration changes
8adeb66 HEAD@{3}: commit: config update
c1ffcbe HEAD@{4}: commit: domain change
e502155 HEAD@{5}: commit: initial commit
e3ab179 HEAD@{6}: commit: configs
fe11182 HEAD@{7}: commit: use the vitae theme
a61266f HEAD@{8}: clone: from https://github.com/stuboo/blog.git

Upvotes: 0

Views: 504

Answers (1)

Jeet
Jeet

Reputation: 5659

Check this if you have added the files to index before sync you may get it back - Git Commit & Sync Deleted All files

Hope it helps.

Upvotes: 2

Related Questions