Reputation: 5313
I am working on managing our project through GIT. I have Intellij Idea and Git running. The git project is running on one of our servers, which are we connecting through ssh.
Currently, everything is working fine except reverting commits. Somehow the reverts are either failing or not changing anything.
For reverting any last commit, I am going in VCS-->Git-->Reset head(Hard)
, but it is not helping. Before doing that I have pushed commit to master and I am currently(always) working on master. Is that a problem and is that causing revert to not function.
Now, as you can see in the screenshot below, the last commit named Test1234
is responsible for removing a simple System.out
and I am trying to revert it commit Test123
, which adds a System.out
. What am I doing wrong?
Output of git status
:
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
The commits in GitGraken :
I don't know which information related to git to post. Kindly let me know if anything is required.
Upvotes: 1
Views: 3097
Reputation: 198
Try right click to the previous commit in IntelliJ and choose reset current branch to here
When I activate this plugin right it works as the previous image
Upvotes: 3
Reputation: 97
Perhaps try github's commandline, you'd be able to identify the problem. I also had problems, github's commandline is much better and works faster (especially for reverting / deleting commits).
See http://christoph.ruegg.name/blog/git-howto-revert-a-commit-already-pushed-to-a-remote-reposit.html as reference
Upvotes: 1