Earlier today I performed a git reset --hard 12345abc to revert my local copy back to a specific commit. Now when I try to push new changes to origin master, I am getting the following error:
Note: “12345abc” above is an example commit number
error: failed to push some refs to 'git@github.com:example/example.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
How can I go ahead and commit my new changes and push them to origin master?
will solve your issue.
Note: unless referred to by other commits, a branch or a tag,
12345abcand all its child commits will be garbage-collected (since nothing references them anymore, Git assumes they are useless)