shamilkhan / git-cheatsheet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚒ 🐻‍❄️ Git Cheatsheet

🐯🧛‍ Branches

🧟 Move branch to commit hash

checkout master to commit hash:

git branch master hash/branch name -f
git checkout -B master hash/branch name

👯‍♀️ Show commit changes

By default show current commit changes:

git show
output:
+const foo = () => {
+ return "bar";
+ }
- cosnt deletedFn = () => "deleted"
- const deletedLine = "deletedLine";

Get changes by hash/baranchName

git show hash
git show development

👽 Show changes N commits back

one commit back

  git show HEAD~

two commits back

  git show HEAD~~
  git show HEAD~2

N commits back

  git show HEAD~~~(N count)
  git show HEAD~N

About