Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

cancel a commit not pushed

git reset --soft HEAD~
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

delete a pushed commit

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

PREVIOUS NEXT
Code Example
Shell :: bash load file into list 
Shell :: how to verify my ssh key password 
Shell :: install npm colors 
Shell :: install elasticsearch 
Shell :: unix change timestamp of file 
Shell :: git configure upstream 
Shell :: clean journal 
Shell :: docker desktop kubernetes dashboard 
Shell :: replace using sed 
Shell :: hoe to install LAMP on ubuntu 
Shell :: how to create a file with a given size in linux? 
Shell :: list user groups linux 
Shell :: windows print environment variable powershell 
Shell :: how to delete a folder from the terminal ubuntu 
Shell :: run mutiple sass files at once 
Shell :: git push to another repository 
Shell :: ubuntu 20 wordpress doesnt work permalinks 
Shell :: ubuntu terminal autocomplete not working 
Shell :: how to delete directory 
Shell :: how to list brew packages installed 
Shell :: install specific version of docker on ubuntu 
Shell :: macos install ruby 
Shell :: cuda driver install in ubuntu 
Shell :: could not find tools.jar linux 
Shell :: linux whereis command 
Shell :: conda install flake8 
Shell :: how to give permission to a user in linux on a folder 
Shell :: ubuntu send input to screen 
Shell :: git delete branch upstream 
Shell :: linux convert png favicon 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =