
It updates the files in the working directory to match the version stored in that branch, instructing Git to record all the new commits. The command works with the git branch command. It operates on files, commits, and branches and allows switching between multiple features in just a single repository. The git checkout command switches branches or restores working tree files. Untracked files are those created within the working directory but are not yet added to the staging area. Unlike the other commands, this command operates on files already added to the Git staging area and runs on untracked files. The git clean is an undo command that completes other commands like git reset and git checkout. To remove all the stashes, you should use git stash clear. You can delete the stash with git stash drop. It takes both staged and unstaged changes, saves them for further use, and then returns them from your working copy. The git stash command shelves changes made to your working copy so you can do another work, get back, and re-apply them. The staging area allows collecting all changes to get a clean commit.

The next commit will transfer all items from the staging area into your repository.

The changes within the staging area are part of the next commit. Staging the file will place the file into the staging area. The staging area (index) is a container where Git gathers all changes which will be part of the next commit.Įditing a versioned file on the local machine, will be recognized by Git as a modified file and be called as unstaged. Git reset -hard Staged and Unstaged Changes ¶
