-
Notifications
You must be signed in to change notification settings - Fork 0
/
stage.new
32 lines (26 loc) · 866 Bytes
/
stage.new
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
30
31
32
git add filename
or
git add --all
to add new files to staging area, than those files are
call be tracked.
How to Unstage?
git reset HEAD <file> ...
HEAD here refer to last commit in current branch.
note that <file> still reserve their changes.
If you want to discard the changes.(staged file -> unstaged and unchanged)
git checkout -- <file>
git diff
to see unstaged change to last commitment.
if you staged, then use
git diff --staged
instead.
If you found that last commitment you just did are wrong, like forget a file to
commit, you can undo last commitment, back to status that just before that commitment
by runing:
git reset --soft HEAD^
Then you can find everthing back to staged.
git reset --hard HEAD^
like the pervious one but discard the changes also.
ONE LAST WORDS: DO NOT USING CHANGE HISTORY COMMAND LIKE
git reset --soft HEAD^
ONECE YOU PUSH.