To delete the branch from remote:
git push origin --delete <branchName>
To delete the branch locally:
git branch -D <branchName>
For aborting the merge, follow the sequence:
-
git merge --abort
-
git reset --merge
To revert the last commit (which has not been pushed):
git reset --soft HEAD^
It helped come out of the baffles and save so much of our time.Thank you for posting this,..
Hi Prashant Gupta,
Thanks for providing these life saver git commands. Your post helps me a lot, thanks once again.