Answers for "remove a git commit locally"

5

git delete local commit

git reset --hard origin/<branch_name>
Posted by: Guest on June-19-2020
2

how to delete a commit from a branch

# How to stash and remove a commit from a branch that has already been pushed

git stash save "<comment>"
git stash pop

# git stash list

git reset --hard HEAD~1
# 1 stands for the amount of commits to go back from HEAD

git push origin HEAD --force
Posted by: Guest on August-04-2021
0

delete everythng after a certain commit

git reset HEAD@{index}
Posted by: Guest on September-28-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language