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 :: ansible run multiple shell commands 
Shell :: print in bash 
Shell :: commitlint install 
Shell :: npm -s flag 
Shell :: enable site 
Shell :: php artisan doctrine migrations add all 
Shell :: how to run git bash from powershell 
Shell :: git pull rebase 
Shell :: git reset a single file to previous commit 
Shell :: install kubectl on linux 
Shell :: How to update newer git version on ubuntu 18.04 by using command line terminal. 
Shell :: start stop restart pm2 
Shell :: docker image prune 
Shell :: error: refs/remotes/origin/PLAT-4366 does not point to a valid object! 
Shell :: git ignore after commit 
Shell :: Git command to Change the Author Information Just for the Next Commit 
Shell :: uninstall package with yarn 
Shell :: crontab command 
Shell :: bash replace specific line in file 
Shell :: how to make new branch and switch in git 
Shell :: Could not extract RVM sources 
Shell :: stack navigator 
Shell :: install docker-compose ubuntu 20.04 
Shell :: install scala on mac 
Shell :: docker loki 
Shell :: how to install gnome-shell-extension-appindicator 
Shell :: brownie list saved accounts 
Shell :: clear tracked files from git 
Shell :: growth ebs disc ec2 running 
Shell :: pacman corrupted package 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =