A local branch:-
'feature/100'
And Remote branches:-
'master'
'Version2'
Accidently,
But in real 'feature/100' should have been merged into remote branch 'Version2'
How I fixed it (partially):-
i have merged the feature branch 'feature/100' to the remote branch 'Version2' and pushed it to the server.
git checkout Version2
git merge --squash feature/100
git add .
git commit -m 'New message'
But I want to delete the last push I have merged and commit to the master branch. How?
Side Note I am only one working on this project.. So even if pushed commit is deleted it won't harm anyone else
You can always drop the latest revert commit (which reverts the oldest commit) with g reset --hard HEAD~ . To find out the hash of the commit(s) you can use git log . Look at the git-revert man page for more information about the git revert command.
It's probably too late, but if you want to rewind your pushed branch (master
?) by one commit, issue the following command:
git push origin +master^:master
+
makes the push forced, master^
describes the previous-last commit. :master
pushes to the remote master branch.
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