Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

cancel a commit not pushed

git reset --soft HEAD~
Comment

git delete last commit after push

git reset --hard HEAD~1
git push -f <remote> <branch>
Comment

git delete pushed commit

git reset --hard <last_working_commit_id>

git push --force
Comment

delete a pushed commit

# delete the last commit
$git reset –hard HEAD~
Comment

remove commit not pushed

git reset --hard origin/main
Comment

git remove last pushed commit

git reset --hard 'xxxxx'

git clean -f -d

git push -f
Comment

git delete pushed commit

git reset --hard your local branch to remove changes from working tree and index, 
git push --force (or git push --force-with-lease) your revised local branch to the remote

check the full answer from here 
https://stackoverflow.com/questions/3293531/how-to-permanently-remove-few-commits-from-remote-branch
Comment

delete last pushed commit

$ git reset <previous label or sha1>
$ git commit -am "blabla"                    <--- optional
$ git push -f <remote-name> <branch-name>    
Comment

github undo last pushed commit

git reset <previous label or sha1>
git commit -am "blabla"
git push -f <remote-name> <branch-name>
Comment

delete a pushed commit

$git log --pretty=oneline --abbrev-commit
Comment

PREVIOUS NEXT
Code Example
Shell :: Got socket error trying to find package cupertino_icons at https://pub.dartlang.org. 
Shell :: redis mac 
Shell :: Anydesk remote server display not supported e.g Wayland 
Shell :: strip first character form output linux 
Shell :: No such keg: /usr/local/Cellar/git 
Shell :: how to rename a file on cmd prompt to current date 
Shell :: rm rf except one directory 
Shell :: ubuntu uninstall composer 
Shell :: download dropbox on linux 
Shell :: git new branch create 
Shell :: how to make QtWebengine have smooth scrolling 
Shell :: Create Flask Virtual Environments 
Shell :: vsode zsh 
Shell :: syntax error: unexpected end of file bash 
Shell :: jquery timepicker plugin 
Shell :: docker copy file not found 
Shell :: how to download jira 
Shell :: react native navigation 
Shell :: git push f head 
Shell :: Play any video on Ubuntu 
Shell :: torshammer github 
Shell :: redirect to file 2&1 
Shell :: Run shell script with typescript 
Shell :: shell iterate over lines in variable 
Shell :: how to install msfconsole in ubuntu 
Shell :: git exclude folder 
Shell :: how to add line number to a file 
Shell :: write content in file powershell 
Shell :: how to count number of running processes in windows 
Shell :: how to start elasticsearch correctly 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =