- untracked: new files in a directory that has not been tracked (excluding ignored files)
- unstaged: new changes on tracked files that have not been staged or stashed
- staged (new file): staged new files that does not exists in local or remote repository (e.g. using
git add
command) - staged: staged changes (excluding new files) (e.g. using
git add
command) - committed: new files or changes that have been committed (e.g. using
git commit
command) - published: pushed commits (using
git push
command)
Follow the colors to see how you can traverse between different states.
Using git restore .
discards changes on unstaged changes and does not affect untracked or staged, or committed changes.
git reset --mixed HEAD~1
causes newly added files that have been staged to be untracked and also unstage all commited or staged changes