2

I am currently learning Git commands but for the moment I using the desktop version of GitHub. I am running into when I try to revert after branching and merging and was wondering if anyone could provide some insight into it.

My problem is that when I try to revert an old commit I get an error message telling me I cannot revert a merge commit. The process I have been using is to branch from master, add feature, merge feature to master. Is there any way around this as I need to revert the changes that I made in one of the branches that I merged. At the moment my timeline would look something like this.

*--*--*--*--A------------B------------C [master]
             \          / \          /
              *--*--*--*   *--*--*--*
              [feature1]   [feature2]

So At the moment I am at point C in the master and would like to revert the changes I made in feature2 so I would essentially be at B again but as I say GitHub Desktop does not allow me to do so. I am getting pretty comfortable with the Git commands using PowerShell so if it would be possible to solve any of my issues with Git commands I would be happy to try it.

Scott Weldon
  • 9,673
  • 6
  • 48
  • 67
user1649972
  • 381
  • 3
  • 14
  • 3
    Possible duplicate of [How to revert a merge commit that's already pushed to remote branch?](http://stackoverflow.com/questions/7099833/how-to-revert-a-merge-commit-thats-already-pushed-to-remote-branch) – 1615903 Oct 11 '16 at 08:51
  • 1
    If you are planning on re-merging `feature2` later, take a look at [Re-doing a reverted merge in Git](//stackoverflow.com/q/1078146/2747593). – Scott Weldon Oct 11 '16 at 16:09
  • Awesome I will have a read now, thanks – user1649972 Oct 12 '16 at 08:53

0 Answers0