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

revert a specific old commit

git revert 797832c
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

git go back to specific commit

// The '.' is needed to attached HEAD!
$ git checkout <commit_id> .
$ git add .
$ git commit -m "go back to <commit-id>"
$ git push
// checkout source for full details!
Comment

PREVIOUS NEXT
Code Example
Shell :: install neovim 
Shell :: read file line loop in bash 
Shell :: gimp apt 
Shell :: enable ssh linux 
Shell :: remi repo 
Shell :: git diff two commits 
Shell :: how to reset ubuntu 20.04 
Shell :: magento installer 
Shell :: Error: Unable to find a match: ansible 
Shell :: how to use gitignore to ignore a folder 
Shell :: get current working directory ubuntu 
Shell :: vijm jump to end of file 
Shell :: git add all files 
Shell :: how to add opt/homebrew/bin to the PATH m1 macbook 
Shell :: clear log file space linux 
Shell :: mkdir with permissions 
Shell :: gnome 42 force dark mode 
Shell :: react-darkmode-toggler 
Shell :: git move change from master to new branch 
Shell :: flutter pubspec install 
Shell :: docker delete image 
Shell :: create ssh key for github 
Shell :: heroku delete branch 
Shell :: screenshot to clipboard ubuntu 20 
Shell :: command not found mvn 
Shell :: Command "server:run" is not defined. 
Shell :: run typescript compiler 
Shell :: Package signatures do not match previously installed version; ignoring! 
Shell :: generate signing key android 
Shell :: kubectl port-forward 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =