I have a problem with the following situation:
- several commits are pushed to a remote (our codereview system)
- developer has rewritten history (edited some commit during a rebase) locally
- when attempting to push again, codereview does not accept it (as this change can already haved passed review)
How can I ‘reset’ a -single- commit to what is in this remote?
The modified commit is not always HEAD, so I cannot simply do ‘git reset –hard HEAD^ && git pull’.
edit:
Preferably the diff between the two versions are created as a new commit, but it is not really a necessity.
Check the reflog with:
Then pick the HEAD that corresponds to the commit of your choice, e.g.
would reset your branch to the point HEAD pointed at five commits ago.