git restore: Discard changes in the working directory or unstage files (modern replacement for part of git checkout). git restore discards changes to files or unstages them. git restore config.php throws away your uncommitted changes to that file, and git restore --staged config.php removes it from the staging area while keeping your edits.
It was introduced to take over the file-related jobs of git checkout, with clearer names and fewer surprises. You can also restore a file from another commit: git restore --source=HEAD~2 config.php.
What should you keep in mind with git restore?
Remember that discarded working changes are gone for good; Git never stored them. Run git diff on the file first if you are not sure what you would lose. If you only want to put changes aside for a moment, git stash is the safer choice, because you can bring them back later.
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback
'Prompt and workflow for generating conventional commit messages using a structured XML format. Guides users to create standardized, descriptive commit messages in line with the Conventional Commits specification, including instructions, examples, and validation.'