Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

revert to a particular commit git

git reset --hard <SHAsum of your commit>
git push -f
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 :: powershell copy file content to clipboard 
Shell :: install brew mac 
Shell :: amplify delete storage 
Shell :: ERROR: No matching distribution found for torch.fx 
Shell :: sudo apt install xfce4 xfce4-goodies -y 
Shell :: material ui icons installation 
Shell :: uninstall package with yarn 
Shell :: camera for linux 
Shell :: crontab example 
Shell :: linux ping latency print on screen .sh file 
Shell :: install docker debian 
Shell :: compare two files shell script 
Shell :: copy code from one repo to another git 
Shell :: Android get abi version 
Shell :: how to install snapd on ubuntu 
Shell :: github download 
Shell :: powershell tcp reverse shell 
Shell :: update msfconsole 
Shell :: how to add this package include: package:flutter_lints/flutter.yaml 
Shell :: bash get lines between 
Shell :: removing portion of history from terminal mac 
Shell :: uninstall flake 8 in vs 
Shell :: git stash error: unknown switch `e‘ 
Shell :: git remote add ssh 
Shell :: bash execute command in variable 
Shell :: install radium 
Shell :: dropbox linux 
Shell :: windows command to grant permission to a directory 
Shell :: syntax error: unexpected end of file bash 
Shell :: install brew linux 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =