first checkout the master branch:
Git checkout master
then run a git log and get the id of the merge commit.
then revert to that commit:
git revert -m 1 <merge-commit>
With ‘-m 1’ we tell git to revert to the first parent of the mergecommit on the master branch. -m 2 would specify to revert to the first parent on the develop branch where the merge came from initially. Now commit the revert and push changes to the remote repo and you are done. Getting back the reverted changes This changes the data to look like before the merge, but not the history. So it’s not exactly like an undo. If we would merge develop into master again the changes we reverted in master wont be applied. So if we would like these changes back again we could revert our first revert(!).
git revert <commit-of-first-revert>
view the log of a single file
git log --follow -p <filename/path>
git rebase squash
git rebase -i