Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git delete last commit local and remote

# Undo the last commit locally 
git rebase -i HEAD~1

# Push to update the remote branch
git push --force
Comment

git remove last commit origin

//Undo the last commit locally 
git reset HEAD^

//then push to the remote repository
git push origin +HEAD
Comment

git delete last commit in remote

1
$git rebase -i HEAD~2
Comment

Removing last commit locally or remotely

// after adding a file mistakenly to commit
// git log to see how many times you have committed the changes so as to know how many times 
// you would reset the commit
git log
// after getting how many times you would reset for example 5 times, then run below code 5 times
git reset HEAD~1
// then proceed to add again
git add .
Comment

PREVIOUS NEXT
Code Example
Shell :: install git win terminal 
Shell :: bash service list 
Shell :: bash echo can create file 
Shell :: install virtualmin 
Shell :: install pip anacodna 
Shell :: what process consuming RAM 
Shell :: git remove cache 
Shell :: apt install antiword 
Shell :: yarn upgrade typescript 
Shell :: completely uninstall apache2 
Shell :: linux repository list 
Shell :: connect redis cli 
Shell :: open firewall port in linux 
Shell :: install sequelize cli 
Shell :: git reset to latest commit 
Shell :: how to close a port mac 
Shell :: color picker linux 
Shell :: aws cli download multiple files s3 
Shell :: bash calculate the mean of a column 
Shell :: update yarn global 
Shell :: fatal: index file corrupt 
Shell :: git diff with vimdiff 
Shell :: bash: pipe all out and error to file 
Shell :: linux how to kill any process on port 
Shell :: fatal: unable to access Could not resolve host wsl 
Shell :: git log --graph 
Shell :: linux check path variable 
Shell :: how to stop build in heroku 
Shell :: heroku procfile laravel 
Shell :: yarn test only one file 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =