Used GitHub GUI to COMMIT&SYNC and everything disappeared

蹲街弑〆低调 提交于 2019-12-06 12:08:34

问题


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



来源:https://stackoverflow.com/questions/15773716/used-github-gui-to-commitsync-and-everything-disappeared

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!