Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git return to last commit

git log
    commit 101: bad commit    # Latest commit. This would be called 'HEAD'.
    commit 100: good commit   # Second to last commit. This is the one we want.
To restore everything back to the way it was prior to the last commit, we need to reset to the commit before HEAD:

git reset --soft HEAD^     # Use --soft if you want to keep your changes
git reset --hard HEAD^     # Use --hard if you don't care about keeping the changes you made
Comment

how to revert to last git commit

git checkout . #This will get rid of all uncommited change
Comment

git revert last commit

git revert HEAD
Comment

git revert to last commit

git reset --hard branch_name #Reverts all modified files to last commit on branch
Comment

PREVIOUS NEXT
Code Example
Shell :: install formik 
Shell :: delete file linux terminal 
Shell :: code to change the mac address kali linux 
Shell :: could not find tools.jar linux 
Shell :: install angular ubuntu 
Shell :: un add file in git 
Shell :: unable to import wx 
Shell :: git tutorial 
Shell :: afficher le contenu de la variable path 
Shell :: how to install apache2 on ubuntu 20.04 
Shell :: delete a file from repo history 
Shell :: new branch not showing in visual studio 
Shell :: for loop iteration in shell script 
Shell :: how to call a batch file from another batch file 
Shell :: git pull sith ssh key 
Shell :: remobve git remote 
Shell :: docker-compose build context tag own name 
Shell :: linux convert png favicon 
Shell :: linux cli see screen resolution 
Shell :: vlc media player download for fedora 
Shell :: npm install --save-dev @angular/cli@latest 
Shell :: bash find text in specific file 
Shell :: ionic capacitor android 
Shell :: docker start exited container 
Shell :: ubuntu take screenshot with cursor 
Shell :: interesting bash scripts 
Shell :: genereate ssh key 
Shell :: kafka confluent download 
Shell :: pip not installing packages 
Shell :: …or push an existing repository from the command line 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =