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 :: create user in linux 
Shell :: find command path 
Shell :: shell list all files in directory 
Shell :: fatal: failed to install gitlab-runner: service gitlab-runner already exists 
Shell :: powershell security 
Shell :: where is upower linux 
Shell :: permission in linux 
Shell :: failed to execute child process gnome-software no such file 
Shell :: ignore .idea in gitignore 
Shell :: show output after a keyword in shell script in a file 
Shell :: git worktree prune 
Shell :: npm audit undu 
Shell :: bash function parameter 
Shell :: docker no space left on device ubuntu but only 75% use? 
Shell :: git added and modified files 
Shell :: flutter live reload chrome 
Shell :: kubectl patch annotation 
Shell :: how to install helm 
Shell :: bash if unset 
Shell :: bash script expand string on spaces 
Shell :: script delete files older than 
Shell :: pyinstaller add files 
Shell :: ssh config only key 
Shell :: install jenkins 
Shell :: regex final word 
Shell :: telnet command 
Shell :: npm install react-navigation-stack 
Shell :: how to save powershell config 
Shell :: rsync delete old files 
Shell :: bash start two processes at the same time 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =