Answer the question
In order to leave comments, you need to log in
How to undo a Git commit?
Developed the project, made commits.
Next, I rolled back two commits by running git reset --hard HEAD^ twice.
Then I created the new branch with git branch new, switched to it with git checkout new
, and deleted the master branch with git branch -d master.
Tell me how to get back to the "as it was" state again?
Answer the question
In order to leave comments, you need to log in
start here: git reflog
those things on the left in the output of the command can be used as identifiers in the checkout.
then, having felt all the depth, read about git fsck and git gc.
If all else fails, shut up :-D
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question