The Problem:
I know I could do git revert -n "my specific commit"..HEAD the problem with that is that it stops at the first merge. passing -m 1 would fix that, but then it stops at non merges.
git reset --hard and force pushing is NOT an option. I can't force push on this git host.
The Situation: (why would I need this)
I know there are lot's of issues around this on here, but I haven't found one with this exact problem and a reasonable solution without force pushing.
git reset --hard good_commit_hash
git reset --soft current_commit_hash
git commit
will do what you want.
(You can simply use "@{u}" as "current_commit_hash" if the upstream (remote) branch is the place where you want to commit on.)
Short: if you want to do any kind of cleanup in your repository, use git reset. It's kind of swiss army knife.
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