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 initial commit

git update-ref -d HEAD
Comment

reset to commit

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

undo reset commit git

git reflog //to get commitID
git reset #commitID
Comment

reset to commit

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

PREVIOUS NEXT
Code Example
Shell :: source.list kali linux 
Shell :: ssh-copy-id windows 
Shell :: visual studio code arm64 
Shell :: uuid 
Shell :: linux run command in loop 
Shell :: metasploit install kali linux 
Shell :: snap install microsoft teams 
Shell :: git can we reset a new branch to a specific commit 
Shell :: sudo passwordless 
Shell :: find all files edited after date linux 
Shell :: install pypy3 ubuntu 
Shell :: ionic capacitor v3 run android livereload 
Shell :: how to clean up all docker containers 
Shell :: restart nginx ubuntu 
Shell :: phoneinfoga github 
Shell :: install lutris kali linux 
Shell :: install brave in ubuntu 
Shell :: ngrok manjaro 
Shell :: bash: /var/lib/snapd/snap/bin/docker-compose: No such file or directory 
Shell :: windows uvicorn not found 
Shell :: vlc media player download ubuntu 
Shell :: pipenv not found after pip3 install 
Shell :: save git password and username once 
Shell :: search guard docker 
Shell :: git error invalid path 
Shell :: how to install scikit-learn 
Shell :: uninstall cortana 
Shell :: kill a process by looking up the port in windows 
Shell :: how to uninstall vpython 
Shell :: fish disable welcome message 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =