Within my master branch, I did a git merge some-other-branch
locally, but never pushed the changes to origin master. I didn\'t mean to merge, so I\'d like to un
It can be done multiple ways.
1) Abort Merge
If you are in-between a bad merge (mistakenly done with wrong branch), and wanted to avoid the merge to go back to the branch latest as below:
git merge --abort
2) Reset HEAD to remote branch
If you are working from remote develop branch, you can reset HEAD to the last commit on remote branch as below:
git reset --hard origin/develop
3) Delete current branch, and checkout again from the remote repository
Considering, you are working on develop branch in local repo, that syncs with remote/develop branch, you can do as below:
git checkout master
##to delete one branch, you need to be on another branch, otherwise you will fall with the branch :)
git branch -D develop
git checkout -b develop origin/develop