Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git remove commit

# Removes latest commit from the stash, KEEPS changes
git reset --soft HEAD~

# Removes latest commit from the stash, DELETES changes
git reset --hard HEAD~
Comment

delete commit

git checkout master
git reset --hard e3f1e37
git push --force origin master
# Then to prove it (it won't print any diff)
git diff master..origin/master
Comment

how to delete a commit from a branch

# How to stash and remove a commit from a branch that has already been pushed

git stash save "<comment>"
git stash pop

# git stash list

git reset --hard HEAD~1
# 1 stands for the amount of commits to go back from HEAD

git push origin HEAD --force
Comment

delete commit

git revert dd61ab23
Comment

PREVIOUS NEXT
Code Example
Shell :: WslRegisterDistribution failed with error: 0x8000000d 
Shell :: find linux 
Shell :: mongodb install kali linux 
Shell :: bash random int 
Shell :: how to globally uninstall npm package 
Shell :: kill process on linux 
Shell :: powershell restart computer 
Shell :: How to open webpage in vbscript 
Shell :: remove remote 
Shell :: windows change hostname 
Shell :: bash if set variable 
Shell :: LINUX TEST FOLDER EXITS 
Shell :: générer clef ssh 
Shell :: git bash posh git 
Shell :: search git history 
Shell :: create new repo 
Shell :: git revert pr merge 
Shell :: Curl default connect-timeout 
Shell :: react app deploy on github pages 
Shell :: github git init main 
Shell :: password generator bash 
Shell :: remove file from terminal ubuntu 
Shell :: install and import gsap in vue 
Shell :: git fatal bad revision cherry-pick 
Shell :: wslconfig example 
Shell :: elk max virtual memory areas vm.max_map_count [65530] is too low 
Shell :: how to push existing project to github 
Shell :: git pull --tags origin main remote: Repository not found. 
Shell :: check who is logged in to system linux 
Shell :: ubuntu kill service 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =