I just made a push on the production site and all the changes were on master. But i realized the code that i pushed needs to be altered so i need to revert the last commit but take all that code from that commit and put it in another branch so i can push it later….any way to do this
Share
There are many ways to fix this.
Here’s what I’d do (with a bit of extra insurance)
Assuming your HEAD is in ‘the wrong place’ (no pun intended), you can
Now edit / rescue you commit in-place (because the last commit’s changes are now pending again). If there is an emergency, you can always checkout the
rescuebranch, which is simply a copy of the HEAD when you started this post.