Horje
git remove last pushed commit Code Example
undo commit
# KEEP CHANGES
git reset --soft HEAD~1

# REMOVE CHANGES
git reset --hard HEAD~1
cancel a commit not pushed
git reset --soft HEAD~
git delete last commit after push
git reset --hard HEAD~1
git push -f <remote> <branch>
git delete pushed commit
git reset --hard <last_working_commit_id>

git push --force
git remove commits from branch after push
git reset --hard <last_working_commit_id>
So we must not reset to the commit_id that we don't want.

Then sure, we must push to remote branch:

git push --force
git remove last pushed commit
git reset --hard 'xxxxx'

git clean -f -d

git push -f




Shell

Related
chmod a+x Code Example chmod a+x Code Example
how to install virtualbox in ubuntu 18.04 Code Example how to install virtualbox in ubuntu 18.04 Code Example
grep wildcard Code Example grep wildcard Code Example
debian install nvidia driver Code Example debian install nvidia driver Code Example
git commit message editor vscode Code Example git commit message editor vscode Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11