I have a problem with the following situation:
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.
Reverting has two important advantages over resetting. First, it doesn't change the project history, which makes it a “safe” operation for commits that have already been published to a shared repository.
Check the reflog with:
git reflog
Then pick the HEAD that corresponds to the commit of your choice, e.g.
git reset --hard HEAD@{5}
would reset your branch to the point HEAD pointed at five commits ago.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With