git remove las remotet commit 1

git remove las remotet commit

git reset HEAD^ # remove commit locally
git push origin +HEAD # force-push the new HEAD commit

Here is what the above code is Doing:
1. git reset HEAD^ — this will remove the last commit from the current branch.
2. git push origin +HEAD — this will force push the current branch to the remote.

Similar Posts