Answer the question
In order to leave comments, you need to log in
Reverting a commit in a local repository via PHPStorm
Can you please tell me how to undo a commit in the local repository via PHPStorm? As I understand it, you need to do a checkout, but in PHPStorm there is a checkout only for remote repositories, but I didn’t find it for local ones.
In general, I recently started to learn Git. Much is still unclear.
Answer the question
In order to leave comments, you need to log in
To undo a commit, you need to do a reset. checkout is only to undo changes for a single file.
in PHPStorm - VCS -> Git -> Reset HEAD.
That's what happens when they don't read git docs and use it with left hand tools.
There are 2 ways to cancel a commit:
reset - resets the branch label to the desired commit, the new commit will essentially be a branch. If you use a remote repository or someone updates from you, then this method is not recommended.
revert is a safe way. Creates another commit.
git-scm.com/book/ru - read it, even in Russian.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question