I'm using Tortoise GIT and would like to discard recent commits and reverting to a specific commit.
My attempt to do this is as follows.
When I attempt to push I get an error
[rejected] my branch -> mybranch (non-fast-forward)
hint: Updates were rejected because the tip of your current branch is
behind hint: its remote counterpart. Integrate the remote changes
(e.g. hint: 'git pull ...') before pushing again.
What am I doing wrong?
For info, I tried selecting the commits and selecting revert, however this failed on two commits which were merges from another branch. I'd therefore like to skip the revert and reset to the version before these commits.
I don't have permissions to force the push.
If I perform a pull, this simply reverts back to the original head.
Thanks for any help.
If you're doing a git reset and you pushed those commits already, you need a force push as you're rewriting history. (side node, to do a force push in TortoiseGit, select the "known changes" checkbox)
But another option is to revert the commits, which create a new commit with the reverted changes.
You could do that as follows in TortoiseGit: