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 to last commit

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

PREVIOUS NEXT
Code Example
Shell :: powershell pc battery command 
Shell :: if -z in bash 
Shell :: youtube-dl uninstall mac 
Shell :: bash string interpolation 
Shell :: helm repo list charts 
Shell :: installing docker on amazon linux 
Shell :: how to install bootstrap in angular 11 
Shell :: change password raspberry pi 
Shell :: how to install sublime text 3 on ubuntu 20.04 
Shell :: node install mint 
Shell :: button click event powershell 
Shell :: check changes after git pull 
Shell :: kill localhost port 
Shell :: kubectl top pod 
Shell :: remove git remote 
Shell :: kubernetes auto complete 
Shell :: shell script get arguments 
Shell :: bash see size of directory 
Shell :: linux get lines in file 
Shell :: git delete all remote branches except master 
Shell :: get users linux 
Shell :: git create new repo 
Shell :: ubuntu uninstall fonts 
Shell :: git ignore folder except one file 
Shell :: navigate to folder on mac 
Shell :: ubuntu know username 
Shell :: git clone using ssh key from gitlab 
Shell :: install native run 
Shell :: remove untracked files 
Shell :: how to install wireshark 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =