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

undo last commit pushed

git reset # commitId
# Exemple
git reset 5310517
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

how to undo last pushed commit

git revert <commit_hash>
Comment

PREVIOUS NEXT
Code Example
Shell :: how to start mongodb server in ubuntu 
Shell :: linux shuton after time 
Shell :: pod install react native failed 
Shell :: pipe command in linux 
Shell :: github commit 
Shell :: how to install ssl certificate in aws lightsail 
Shell :: install discord 
Shell :: npm TypeError [ERR_INVALID_ARG_TYPE]: 
Shell :: use latex in github readme 
Shell :: case insensitive zgrep 
Shell :: dpkg install force 
Shell :: how to install cuda on ubuntu 
Shell :: get serial number cmd remotely 
Shell :: how to disable a wifi card raspberry pi 
Shell :: wordpress update all plugins cli 
Shell :: pwd linux 
Shell :: how to install terraform on Ubuntu/Debian 
Shell :: how to update to latest version of chrome in ubuntu 17.04 
Shell :: creating a 2d array in a script in linux shell 
Shell :: powershell array pipe foreach 
Shell :: git grep in commits 
Shell :: Simulate keys with powershell 
Shell :: git https to ssh 
Shell :: create scheduled task via powershell scheduled reboot 
Shell :: generate crt and key openssl 
Shell :: react hook install 
Shell :: windows features windows subsystem for linux not 
Shell :: powershell restart computer 
Shell :: fedora microsoft font 
Shell :: download post man in linux 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =