How to Fix Git Pull Into Wrong Branch

I work with git almost everyday and sometimes I do git pull into wrong branch unintentionally. I believe every programmer should know how to undo git pull because it is very easy.


I’m working on my own branch (Branch B) which checkout from another branch (Branch A) and sometimes when I do git pull, I mistakenly do git pull from master branch.


You only need to execute 3 simple command after the git pull. Normally your git pull will throw an error about merge failed because of conflicts. The command as follows: Continue reading “How to Fix Git Pull Into Wrong Branch”