I realized that I made some mistakes on HEAD, checked out an older commit and started coding from there. When I attempt a push I’m told that my current commit is behind and I need to merge with HEAD. Git recommends "git pull". However, HEAD has the code I want to ignore. How do I solve this problem?
Flowchart:
-------- HEAD (bad) ---------------------- + (behind conflict, requires
\ / merge with HEAD, which is
\------- Current commit (good) ----/ bad and needs to be ignored)
If your repository isn’t being used by other people, you can safely do
git push -fto overwrite the remote branch.