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 :: truncate docker logs 
Shell :: how to enable migration in package manager console 
Shell :: get linux distro from terminal 
Shell :: cocoapods not installed 
Shell :: pytorch anaconda install windows 
Shell :: linux set permissions during copy 
Shell :: azure powershell module 
Shell :: install spotify ubuntu 
Shell :: github set branch upstream 
Shell :: how to change remote location 
Shell :: git command line see logö 
Shell :: git push username password 
Shell :: remove .svn recursively linux 
Shell :: install docker-compose ec2 
Shell :: install tqdm 
Shell :: pyinstaller not found 
Shell :: aws cli ec2 list security groups 
Shell :: ubuntu mouse mover 
Shell :: gpg to decrypt a file 
Shell :: BUILD FAILED (Ubuntu 20.04 using python-build 20180424) 
Shell :: windows docker update clock 
Shell :: evernote linux 
Shell :: assign home directory to user linux 
Shell :: Get all changes of the main branch locally 
Shell :: diskpart assign letter 
Shell :: install heroku cli on linux 
Shell :: conda install netcdf4 
Shell :: adobe connect in ubuntu 
Shell :: find java home 
Shell :: delete aws configure in mac cli 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =