Scenario: I commit, push to the remote server, and then commit something else with --amend. If I try to push again, I'll get an error because I changed history that was already pushed.
- Lets say I don't care about the amended changes, how do I undo this so my history looks like the remote history (discard the --amend changes)?
Lets say I do care about the amended changes, how do I turn the amended commit into a stand alone commit so history looks like this:
commit 1 <- commit 2 (already pushed to server) <- (originally from amended commit)
I'm trying to avoid having to use a push -f
.
This is a very similar question but there is a key difference: In that question, he hasn't pushed commit 1 to a remote repo yet. In my question, I have.