Answers for "git delete pushed commit"

1

cancel a commit not pushed

git reset --soft HEAD~
Posted by: Guest on November-03-2020
5

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
Posted by: Guest on August-01-2020
0

delete a pushed commit

# delete the last commit
$git reset –hard HEAD~
Posted by: Guest on October-20-2020
0

remove commit not pushed

git reset --hard origin/main
Posted by: Guest on June-04-2021
0

git delete last commit in remote

1
$git rebase -i HEAD~2
Posted by: Guest on July-02-2020
0

git delete pushed commit

git reset --hard <last_working_commit_id>

git push --force
Posted by: Guest on September-03-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language