TestProject Forum
Powered by leading experts in the test automation community

Git ignore local commits

I made some mistakes in my project and now my branch is ahead of origin/master by 3 commits

Can I remove the local commits without deleting everything and starting from scratch ?

try running

git reset --hard origin/master

this should remove all the commits that are not in origin/master