I committed some unnecessary code so I used:
git reset HEAD~
I checked out the files and tried to push my last commits (which were correct). However, I'm receiving error: error: failed to push some refs to 'git@github.com:MyProject/MyProject.git'
hint: Updates were rejected because the tip of your current branch is behind
which is probably since the commit is not reverted correctly since when I do git pull, the commit is back again.
How can I correctly revert this commit?
additional info: git status
gives me:
Your branch is behind 'origin/Mybranch' by 1 commit, and can be fast-forwarded.