gitgit-branchgit-detached-head

How can I force branch version on local master?


I had to reset detached head to previous commit. Both master and branch say no local changes to save. Only my local branch works, the local-master does not! How do I make sure the branch version gits to my origin?


Solution

  • Assisted by a Bloc mentor, a solution was to: 1) git log and copy a sha from an earlier commit which we were sure was before the error / bad code occurred, 2) git reset -- hard copied-sha 3) git merge branchname-that-worked-correctly 4)git push -f origin master FIXED