Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ git log
- commit a867b4af366350be2e7c21b8de9cc6504678a61b`
- Author: Me <me@me.com>
- Date: Thu Nov 4 18:59:41 2010 -0400
- blah blah blah...
- commit 25eee4caef46ae64aa08e8ab3f988bc917ee1ce4
- Author: Me <me@me.com>
- Date: Thu Nov 4 05:13:39 2010 -0400
- more blah blah blah...
- commit 0766c053c0ea2035e90f504928f8df3c9363b8bd
- Author: Me <me@me.com>
- Date: Thu Nov 4 00:55:06 2010 -0400
- And yet more blah blah...
- commit 0d1d7fc32e5a947fbd92ee598033d85bfc445a50
- Author: Me <me@me.com>
- Date: Wed Nov 3 23:56:08 2010 -0400
- Yep, more blah blah.
- git checkout -b old-state 0d1d7fc32
- git reset --hard HEAD
- git revert --no-commit 0766c053..HEAD
- git commit
- git reset --hard <commidId> && git clean -f
- git add . && git checkout master -f
- git add . && git reset --hard HEAD
- git reset --soft HEAD~1
- git reset --hard [previous Commit SHA id here]
- git push origin [branch Name] -f
- git reset --soft [previous Commit SHA id here]
- git checkout <commit_id>
- git checkout -b <new branch> <commit_id>
- git checkout HEAD~X // x is the number of commits t go back
- # Checkout a given commit.
- # Doing so will result in a `detached HEAD` which mean that the `HEAD`
- # is not pointing to the latest so you will need to checkout branch
- # in order to be able to update the code.
- git checkout <commit-id>
- # create a new branch forked to the given commit
- git checkout -b <branch name>
- git reflog
- git checkout HEAD@{...}
- fe60adeba6436ed8f4cc5f5c0b20df7ac9d93219
- 0c27ecfdab3cbb08a448659aa61764ad80533a1b
- f85007f35a23a7f29fa14b3b47c8b2ef3803d542
- e9ec660ba9c06317888f901e3a5ad833d4963283
- 6a80768d44ccc2107ce410c4e28c7147b382cd8f
- 9cf6c21f5adfac3732c76c1194bbe6a330fb83e3
- fff2336bf8690fbfb2b4890a96549dc58bf548a5
- 1f7082f3f52880cb49bc37c40531fc478823b4f5
- e9b317d36a9d1db88bd34831a32de327244df36a
- f6ea0e7208cf22fba17952fb162a01afb26de806
- 137a681351037a2204f088a8d8f0db6e1f9179ca
- git rm -r .
- git checkout <commit> .
- git commit
- git reset HEAD~1
- # Revert local master branch to November 3rd commit ID
- git reset --hard 0d1d7fc32e5a947fbd92ee598033d85bfc445a50
- # Revert remote master branch to November 3rd commit ID
- git push -f origin 0d1d7fc32e5a947fbd92ee598033d85bfc445a50:master
- git back
- # Remove the latest three commits
- git back 3
- git push -f ...
- git show HEAD
- git show HEAD~1
- git show HEAD~2
- git reset --hard HEAD~1
- git reset <SHA>
- git reset --hard <SHA>
- git add -A .
- git reset --hard HEAD
- git reset --hard origin/master
- git stash
- git stash clear
- git reset --hard HEAD
- git revert <commit1> <commit2>
- git reset --hard [first-4-letters&numbers-of-commit's-SHA]
- git branch -f <<branchname>> 0d1d7fc32e5a947fbd92ee598033d85bfc445a50
- git reflog
- git reset HEAD@{12} --hard
- git pull --all
- git reset --hard HEAD~1
- git push --force
- git push origin :develop (note the colon)
- git reset --hard EFGHIJK
- git push origin develop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement