Why does git reset commit + git push the reason for the current branch to follow the console?

I wanted to undo a few minor changes in my repo. I decided to go back to two commits and did

git reset --hard <commit>

and

git push -f

Everything went perfectly. But when I clicked on the hero, I had an error in how some links were not clicked, and then this explanation:

Updates were rejected because the end of your current branch is behind its deleted copy. Delete the changes again (for example, "git pull").

Each time I return to the previous commit, I end up with a detached HEAD or tip behind the remote. This does not allow me to click on git or heroku. What for? How do I get around this? What is the proper list of commands to follow so that this does not interfere in the future?

+4
1

, rewrite . , reset rebase.

git revert HEAD~2..HEAD

2 , . .

+2

All Articles