Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git reset to commit

# reset to specefic commit
git reset --hard <commit id>

# to go back one step 
git reset --hard HEAD~1

# note: use --soft to keep file changes
Comment

git reset to latest commit

git reset --hard HEAD~0
will go to latest commit.


git reset --hard HEAD~1
will go to last but one commit.

Note:  Be careful while running this command. it can't be irreversible
Comment

git reset head to previous commit

git reset --hard <commit_id>
Comment

reset to commit

# rollback to commit state
git revert --no-commit 0766c053..HEAD
git commit
Comment

reset to commit

# This will detach your HEAD, that is, leave you with no branch checked out:
git checkout 0d1d7fc32
Comment

reset git from last commit

$ git clean -fd
Comment

PREVIOUS NEXT
Code Example
Shell :: powershell check iso sha256sum 
Shell :: error ppa.launchpad.net/certbot/certbot/ubuntu focal Release 
Shell :: how to remove all files except one in linux 
Shell :: how to initialize a git repository command line 
Shell :: number of directories in a directory linux 
Shell :: get saved wifi password windows 10 
Shell :: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io: device or resource busy 
Shell :: how to install pyqt5 
Shell :: how to remove file changes in git 
Shell :: php curl skip ssl verification 
Shell :: bash calculate the mean of a column 
Shell :: rails rollback multiple migrations 
Shell :: Failed to fetch platform cordova-android@^8.0.0 
Shell :: sveltekit normalize css 
Shell :: libgit2.so.1.1: cannot open shared object file: No such file or directory 
Shell :: install free dbeaver ubuntu 16.04 
Shell :: install kubectx 
Shell :: install pg module 
Shell :: git commit --amend choose editor 
Shell :: bash capitalize vowels using tr 
Shell :: compress a folder linux zip 
Shell :: how to create a bash script 
Shell :: install protonvpn on linux mint 
Shell :: docker run ubuntu image 
Shell :: cmd kill process on port 
Shell :: hash sum mismatch ubuntu 
Shell :: mongodb restart command ubuntu 
Shell :: ConfigurationError: The "dnspython" module must be installed to use mongodb+srv:// URIs 
Shell :: ssh service running ubuntu 
Shell :: linux get all env variables 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =