T
T
Timur2013-07-15 13:38:06
git
Timur, 2013-07-15 13:38:06

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

2 answer(s)
S
Sergey, 2013-07-15
@XAKEPEHOK

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.

A
AgentSIB, 2013-07-15
@AgentSIB

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 question

Ask a Question

731 491 924 answers to any question