Git - Git Revert of Merge

Git is a free and open source distributed version control system. Its known as version controlling. To distribute your code you have to co-operate with other developer. All the code will be merged into single repository. This is good part of working at remote place. But sometime touble happen when you face conflict. I was having same while merging code.

When you are working in different branch and you want to merge your code in master branch you have to checkout to master branch from your branch and then use following command to merge :

git merge

Now, many times I was facing conflict because same file has been edited by any other developer. So what to do if you want to revert your merge ? Here is simple solution I am using :

git merge --abort

Above command will revert your merge and make master branch as it was before your merge.

Hope that helps!!