forked from smileschen/2020-sp-stats-21
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.txt
33 lines (20 loc) · 792 Bytes
/
commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Git
create repository
git init
check status of repository
git status
stage changes:
git add filename
git add .
commit changes:
git commit -m "message describing changes"
check the log of commits
git log
unstage changes
git reset
Scenario 1:
You make changes and save them on your local computer. You decide you want to revert them back to a previous version. You can reset --hard. This will reset the respository to the most recent commit.
git reset --hard
Scenario 2:
You make changes and save them on your local computer. You commit these changes to the repository. You decide you want to revert them back to the previous commit. You can revert. This will undo the most recent commit and you will be back at the second to last commit.
git revert hash_of_most_recent_commit