Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Delete commit from a branch, git remove my committed changes to a specified branch

1.$ git reset --hard HEAD~1 - The HEAD~1 means the commit before head. 

Or, you could look at the output of git log, find the commit id of the commit you want to back up to, and then do this:
$ git reset --hard <sha1-commit-id>

If you already pushed it, you will need to do a force push to get rid of it...
2.$ git push origin HEAD --force
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Delete #commit #git #remove #committed #branch
ADD COMMENT
Topic
Name
3+3 =