D
D
Draek Nelson2019-02-22 13:50:45
git
Draek Nelson, 2019-02-22 13:50:45

How to revert a lost commit?

Uncommitted files were stored on the server.
I uploaded a couple of commits from the master on top of them, which turned out to be buggy and rolled back 2 commits.
Then on the local machine corrected all this business. This is how the commit tree in master looks like.
5c6fd39cab2cf380347861.png
Then I went to the server, made a commit in the HEAD branch and as in the picture.
5c6fd312c7b12615881903.png
Now the 'commit work process' commit has disappeared altogether and is not in any branch.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Laud, 2019-02-22
@daren93

git reflog
Find the point where you haven't done a git pull yet,
git reset --hard <хеш из reflog>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question