I am relatively new to git. I was on a branch called temp, which I had created newly. I did 3 commits and pushed. Then I did a reset back to the 2nd commit and made some changes.
git pull
gives me:
You asked me to pull without telling me which branch you want to merge with, and 'branch.temp.merge' in your configuration file does not tell me, either. Please specify which branch you want to use on the command line and try again (e.g. 'git pull '
git push
gives me:
! [rejected] temp -> temp (non-fast-forward) error: failed to push some refs to 'https://myserver.com/git/project' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details.
I actually want to delete the 3rd commit which I had already pushed, and push the latest commit I have done after resetting to the 2nd commit. How do I do that?