Balasekhar Nelli
Balasekhar Nelli

Reputation: 1295

Git staging to working directory?

I have a question concerning the git reset command:

git reset .
git reset HEAD .

What is the difference between the two commands? Are making same changes?

Upvotes: 3

Views: 2482

Answers (2)

Nima Saed
Nima Saed

Reputation: 111

  1. Git Reset: to undo commits:

    • --soft (does not change stage index or working directory)
    • --mixed (default) (changes stage index to match repository)
    • --hard (change stage index and working directory)

Example: git reset "hashValueOfAnyCommit"

  1. Git Reset HEAD: Unstage file from your stage

Upvotes: 1

Zbynek Vyskovsky - kvr000
Zbynek Vyskovsky - kvr000

Reputation: 18825

Yes, it does exactly the same. If you omit the commit id, it will default to HEAD.

Upvotes: 2

Related Questions