S
S
sorry_i_noob2018-09-24 20:29:17
git
sorry_i_noob, 2018-09-24 20:29:17

I moved the branch to the previous commit and my last commit is gone. How to return it?

I made a commit. And then I moved the master branch to the penultimate commit. And the last one is gone (I use git in phpstorm - the last commit is gone from the list). How to return it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2018-09-25
@sorry_i_noob

1. View all commits:
git log --all
The top one, probably the one that disappeared. Remember his sha.
2.git checkout <memorized sha>
3.Migrate master to latest commit:
git merge master

A
aol-nnov, 2018-09-24
@aol-nnov

Start by opening the console and git reflog

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question