Syntax:
git restore --staged (filename)
Example:
git restore --staged index.html
Note: It will successfully execute if the file is in the staged area; otherwise, it will throw an error stating "did not match any files."
git show-ref
git checkout -b feature-x
or
git switch -b feature-x
Commits are the backbone of Git’s change-tracking system. Each commit acts like a snapshot of your project at a specific point in time, recording what changed, who made the change, and why. This allows Git to maintain a complete history of the project, making collaboration and rollback possible.
The .git folder is the hidden directory that makes a project a Git repository. It stores all the metadata, commit history, branches, and configuration data Git needs to track and manage your project. Without it, your folder is just a regular directory with files.