Quantcast
Channel: How do I delete a commit from a branch? - Stack Overflow
Viewing all articles
Browse latest Browse all 80

Answer by Justin for Delete commits from a branch in Git

$
0
0

If you've already pushed, first find the commit you want to be at HEAD ($GIT_COMMIT_HASH_HERE), then run the following:

git reset --hard $GIT_COMMIT_HASH_HEREgit push origin HEAD --force

Then each place the repo has been cloned, run:

git reset --hard origin/master

Viewing all articles
Browse latest Browse all 80

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>