Due to some bad cherry-picking, my local Git repository is currently five commits ahead of the origin, and not in a good state. I want to get rid of all these commits and st
For those interested in the Visual Studio solution, here is the drill:
Team Explorer
window, connect to the target repo. Branches
, right-click the branch of interest and select View history
. History
window and choose Reset -> Delete changes (--hard)
.That will throw away your local commits and reset the state of your repo to the selected commit. I.e. Your changes after you pulled the repo will be lost.
Simple Solution will be to match local master branch HEAD to origin/master branch HEAD
git reset --hard origin/master
PS: origin/master - is remote pointer to master branch. You can replace master with any branch name