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 :: git how to not commit but keep changes 
Shell :: mv bash 
Shell :: batch set from file 
Shell :: linux password expires date 
Shell :: go back to previous commit 
Shell :: bash command to move all files to a dir 
Shell :: how to install simple screen recorder in fedora 
Shell :: powershell get disk space remote computer 
Shell :: gitlab system variables 
Shell :: hadoop delete directory without url 
Shell :: how to download nessus to kali debian 64 bit vm 
Shell :: powershell function resize image 
Shell :: remove multiple files powershell 
Shell :: screen recorder mint 
Shell :: cs50 cli50 install 
Shell :: how to print array bash 
Shell :: flutter live reload chrome 
Shell :: vi replace 
Shell :: Git - show all commits 
Shell :: dig check dmarc record 
Shell :: open file command linux 
Shell :: install composer v2 ubuntu 
Shell :: bash echo each line 
Shell :: install serial port using npm 
Shell :: How To Make Log File On Batch Script 
Shell :: nodemon installation 
Shell :: find index of string in shell 
Shell :: git hub new repo 
Shell :: xampp phpmyadmin not found 
Shell :: permission denied 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =