git reset <pathspec> is the opposite of git add <pathspec>.
git reset [<commit>] resets the index but not the working tree (i.e., the changed files are preserved but not marked for commit) and reports what has not been updated.

The command git reset <pathspec> will change the index information but not make effect on working directory. It makes the index look like HEAD.

git reset -p is the opposite of git add -p. The reset command will accept a --patch option to unstage content on a hunk-by-hunk basis.

Use Reset To Squash Commits

The original commits:

Move the HEAD back to an older commit and keep the staged files.

Squash commits: git commit -m "add cultrue.txt and shun.txt".

The practice court: Learn Git

Categories: Tool

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments

Computer Number Terms
: You can use the tool to get different expressions of color, disk space and number.

X
A prohibited operation
0
Would love your thoughts, please comment.x
()
x