Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

revert to a particular commit git

git reset --hard <SHAsum of your commit>
git push -f
Comment

how to revert to a specific commit

git revert <commit-hash>
Comment

git revert back to specific commit

# This will create three separate revert commits:
git revert a867b4af 25eee4ca 0766c053

# It also takes ranges. This will revert the last two commits:
git revert HEAD~2..HEAD

#Similarly, you can revert a range of commits using commit hashes (non inclusive of first hash):
git revert 0d1d7fc..a867b4a

# Reverting a merge commit
git revert -m 1 <merge_commit_sha>

# To get just one, you could use `rebase -i` to squash them afterwards
# Or, you could do it manually (be sure to do this at top level of the repo)
# get your index and work tree into the desired state, without changing HEAD:
git checkout 0d1d7fc32 .

# Then commit. Be sure and write a good message describing what you just did
git commit
Comment

Rollback a Particular Commit in git command

git revert 1af17e
Comment

PREVIOUS NEXT
Code Example
Shell :: read a file in batch 
Shell :: how to install gitkraken on fedora 
Shell :: Disable MacBook from Booting Automatically 
Shell :: how to change the name of a usb ubuntu] 
Shell :: get y.output file yacc remove shift reduce conflict 
Shell :: gitignore for django project 
Shell :: github drupalcomposer project 
Shell :: remove alias powershell 
Shell :: kill :80 port 
Shell :: git transfer changes to another branch 
Shell :: get linux distro from terminal 
Shell :: proc folder 
Shell :: pip install quiet 
Shell :: add pg_config to path 
Shell :: copy folder from local to ubuntu server 
Shell :: how to upload laravel project on github using command 
Shell :: remove .svn recursively linux 
Shell :: yii get version 
Shell :: bz2 unzip 
Shell :: npm ignore scripts 
Shell :: bash read file line by line with spaces 
Shell :: boot repair linux 
Shell :: git graph code 
Shell :: chmod for pem file 
Shell :: install zsh 
Shell :: how to install ddos on ubuntu 
Shell :: git show get commit message 
Shell :: trusted installer owner 
Shell :: git untracked content 
Shell :: string manipulation in shell 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =