GIT & GITHUB Flashcards
1
Q
How to set up a new project
A
git init
2
Q
How to stash changes
A
git stash
3
Q
How to get stash , then remove stash
A
git stash pop
4
Q
how to get stash, keep stash
A
git stash apply
5
Q
list stash
A
git stash list
6
Q
get stash
A
git stash@{n} or git stash pop n
7
Q
remove a stash from list
A
git stash drop@{n}
8
Q
move to a commit using ref
A
git checkout
9
Q
move to a commit refrencing head
A
git checkout Head~n
10
Q
switch to last commit
A
git switch -
11
Q
remove changes to a file
A
git checkout Head
or
git restore
12
Q
how to unstage a file
A
git resore –staged
13
Q
Revert commit without changing files
A
Git reset
14
Q
Revert commit with chaginging files
A
git reset–hard
15
Q
Revert commit in collobaration
A
git revert