Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git revert last commit remote

Set the local branch one revision back (HEAD^ means one revision back):
`git reset --hard HEAD^`

Push the changes to origin:
`git push --force`
Comment

how to revert the last commit from the remote

# When you accidently commit  or do unnecessary commit in the remote 
// you can fix this way. 
⚠️ Warning: Your commit won't be saved.

#reset the last commit
git reset HEAD^ --hard

#force push the current changes
git push origin --force

# to save your commit 
git reset --soft HEAD~1 

#stash the changes and then force the changes
Comment

PREVIOUS NEXT
Code Example
Shell :: give write-access of a folder to all users in linux? 
Shell :: centos cpus 
Shell :: centos install netstat 
Shell :: compress folder in tar.gz unix 
Shell :: mamp connect to mysql 
Shell :: install gunicorn 
Shell :: choco update node 
Shell :: speedtest cli ubuntu 
Shell :: how to see the history of the cmd 
Shell :: how i can install composer after download froject from githb 
Shell :: vite react project 
Shell :: display ip address linux 
Shell :: scan network for devices linux 
Shell :: ls human readable file size 
Shell :: install waitress 
Shell :: tailwind plugin prettier 
Shell :: for each line in file bash 
Shell :: install jupyter notebbok in pip 
Shell :: install snap debian 
Shell :: how to unzip tar file 
Shell :: install nodemcu in arduino 
Shell :: Failed at the node-sass@4.7.2 postinstall script. 
Shell :: extract .tz ubuntu 
Shell :: No matching distribution found for PyJWT==2.0.1 
Shell :: save log git hub 
Shell :: brew xampp 
Shell :: linux get recursive directory size 
Shell :: powershell upgrade 
Shell :: see what is using a port ubuntu 
Shell :: check which repo i am on git 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =