⚒ 🐻❄️ 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:
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
two commits back
git show HEAD~~
git show HEAD~2
N commits back
git show HEAD~~~(N count)
git show HEAD~N