EDIT: This questions is not "how to revert to a previous commit".
Let's say my master
looks like this:
A B C D
Let's say I want to push commit B
to the origin/master
without resetting it and losing commit C
and D
.
This is what I get with a normal git reset --hard
, but like I said I lose any commits after B
so that's no good:
A B
Instead, I want the commit chain to look like this:
A B C D B
Is this possible? Put it other words, I want to make the local files match commit B
and then committing them, without resetting the chain. The new commit will technically be commit E
but it's files will be identical to commit B
.
Since this will be run by an automated script I don't want to use branches, potentially creating a crow's nest.