-->

Used GitHub GUI to COMMIT&SYNC and everything disa

2020-07-27 03:45发布

问题:

So in the GitHubGUI, as usual, I did my changes and then clicked Commit&Sync and for a brief moment the "Merge Conflics" dialog popped up and then everything disappeared and I synced the newest changes with the remote repo.

Everything I did disappeared.

This has happened before after I kept clicking commit&sync after merge errors I tried to fix, but this time literally everything just disappeared like I would have just done a pull command and git wouldn't catch my commit.

Is there some way I can recover these files that were committed? The GUI commits them first and then pushes them. So I figure it had to go somewhere lol.

Edit:
Did:

git reflog show
ae0217a HEAD@{1}: rebase finished: returning to refs/heads/master
ae0217a HEAD@{2}: checkout: moving from master to a....(edited letters)
2729389 HEAD@{3}: commit: First side menu change : changed size, colors, and added icons
2bf6181 HEAD@{4}: pull: Fast-forward

So the "commit" is on HEAD@{3} but how do I get back to it or have my changes appear on master?

回答1:

Had to do:

git reset --hard HEAD{3}

to return to my commit that "disappeared."

https://www.kernel.org/pub/software/scm/git/docs/git-reset.html