{
    "url": "https://delaparra-services.nl/knowledge-hub/git-restore",
    "locale": "en",
    "title": "git restore: Knowledge hub | DeLaParra Services",
    "description": "Discard changes in the working directory or unstage files (modern replacement for part of git checkout).",
    "alternates": {
        "en": "https://delaparra-services.nl/knowledge-hub/git-restore",
        "nl": "https://delaparra-services.nl/nl/kennisbank/git-restore"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/knowledge-hub/git-restore.csv",
        "md": "https://delaparra-services.nl/knowledge-hub/git-restore.md",
        "json": "https://delaparra-services.nl/knowledge-hub/git-restore.json",
        "zip": "https://delaparra-services.nl/knowledge-hub/git-restore.zip",
        "pdf": "https://delaparra-services.nl/knowledge-hub/git-restore.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/knowledge-hub/git-restore.csv",
            "encodingFormat": "text/csv",
            "name": "git-restore.csv"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/git-restore.json",
            "encodingFormat": "application/json",
            "name": "git-restore.json"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/git-restore.md",
            "encodingFormat": "text/markdown",
            "name": "git-restore.md"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/git-restore.pdf",
            "encodingFormat": "application/pdf",
            "name": "git-restore.pdf"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/git-restore.zip",
            "encodingFormat": "application/zip",
            "name": "git-restore.zip"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/git-restore/skills.zip",
            "encodingFormat": "application/zip",
            "name": "git-restore-skills.zip"
        }
    ],
    "markdown": "1. [Home](<https://delaparra-services.nl/>) \n1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) \n1. [git restore](<https://delaparra-services.nl/knowledge-hub/git-restore>)\n\n  \n\nCategory: Git commands \n\n# git restore\n\n  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    \n\n## What is git restore?\n\n \n\ngit 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.\n\n \n\nDefinition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)\n\n \n\n## Frequently asked questions about git restore\n\n  \n\n### How is git restore used in practice?\n\n \n\nIt 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 `.\n\n    \n\n### What should you keep in mind with git restore?\n\n \n\nRemember 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.\n\n \n\n## At a glance\n\n   CategoryGit commands Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026\n\n \n\n## More Git commands terms\n\n \n\n- [git rebase](<https://delaparra-services.nl/knowledge-hub/git-rebase>) \n- [git remote](<https://delaparra-services.nl/knowledge-hub/git-remote>) \n- [git reset](<https://delaparra-services.nl/knowledge-hub/git-reset>) \n- [git revert](<https://delaparra-services.nl/knowledge-hub/git-revert>) \n- [git stash](<https://delaparra-services.nl/knowledge-hub/git-stash>) \n- [git status](<https://delaparra-services.nl/knowledge-hub/git-status>)\n\n \n\n[All terms starting with G](<https://delaparra-services.nl/knowledge-hub#letter-g>)\n\n \n\n## Skills\n\n \n\n- ### Git Advanced Workflows\n\n \n\nMaster 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.\n\n [View skill](<https://delaparra-services.nl/skills/git-advanced-workflows>) [Download zip](<https://delaparra-services.nl/skills/git-advanced-workflows/download>) \n- ### Using Git Worktrees\n\n \n\nUse 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\n\n [View skill](<https://delaparra-services.nl/skills/using-git-worktrees>) [Download zip](<https://delaparra-services.nl/skills/using-git-worktrees/download>) \n- ### Conventional Commit\n\n \n\n'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.'\n\n [View skill](<https://delaparra-services.nl/skills/conventional-commit>) [Download zip](<https://delaparra-services.nl/skills/conventional-commit/download>)\n\n [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/git-restore/skills.zip>)\n\n \n\n## Manuals\n\n \n\n- [Git: branches, rebase and merge conflicts](<https://delaparra-services.nl/manuals/git-branches-rebase-en-merge-conflicten>) \n- [Working with Git](<https://delaparra-services.nl/manuals/werken-met-git>)\n\n \n\n## Related services\n\n \n\n- [AI code review](<https://delaparra-services.nl/services#service-05>)\n\nWhen you push your new change, I will review your code, help your agent avoid the same mistake again, and get your app ready for deployment. \n- [Your own coding agent](<https://delaparra-services.nl/services#service-06>)\n\nIf you want to use a coding agent, we provide all the infrastructure to help it work efficiently.\n\n \n\n## Need any help?\n\n \n\nStuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.\n\n  [Get in touch](<https://delaparra-services.nl/availability>)\n\n[HTML version](https://delaparra-services.nl/knowledge-hub/git-restore)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Bespoke software, web applications and mobile apps, developed in Laravel by a single developer in Groningen. Fixed price agreed in advance, full source code provided upon delivery.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, the Netherlands",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Web design and development",
                    "App development",
                    "Custom software and web applications",
                    "OpenSpec",
                    "AI code review",
                    "Your own coding agent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "FAQPage",
                "@id": "https://delaparra-services.nl/knowledge-hub/git-restore#webpage",
                "url": "https://delaparra-services.nl/knowledge-hub/git-restore",
                "name": "git restore: Knowledge hub | DeLaParra Services",
                "description": "Discard changes in the working directory or unstage files (modern replacement for part of git checkout).",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@type": "DefinedTerm",
                    "@id": "https://delaparra-services.nl/knowledge-hub/git-restore#term",
                    "name": "git restore",
                    "description": "Discard changes in the working directory or unstage files (modern replacement for part of git checkout).",
                    "termCode": "git-restore",
                    "url": "https://delaparra-services.nl/knowledge-hub/git-restore",
                    "inLanguage": "en",
                    "keywords": "Git commands",
                    "dateModified": "2026-11-25T17:46:27+00:00",
                    "inDefinedTermSet": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#terms"
                    },
                    "isPartOf": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#dataset"
                    },
                    "subjectOf": [
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/git-restore#webpage"
                        },
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/git-restore#dataset"
                        }
                    ]
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/git-restore#breadcrumb"
                },
                "mainEntity": [
                    {
                        "@type": "Question",
                        "name": "What is git restore?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "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."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "How is git restore used in practice?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "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."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What should you keep in mind with git restore?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "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."
                        }
                    }
                ],
                "author": {
                    "@id": "https://delaparra-services.nl/#person"
                },
                "mentions": [
                    {
                        "@id": "https://delaparra-services.nl/skills/git-advanced-workflows#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/using-git-worktrees#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/conventional-commit#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/manuals/git-branches-rebase-en-merge-conflicten#article"
                    },
                    {
                        "@id": "https://delaparra-services.nl/manuals/werken-met-git#article"
                    }
                ]
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/knowledge-hub/git-restore#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Knowledge hub",
                        "item": "https://delaparra-services.nl/knowledge-hub"
                    },
                    {
                        "@type": "ListItem",
                        "position": 3,
                        "name": "git restore"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/about"
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/knowledge-hub/git-restore#dataset",
                "name": "git restore",
                "description": "Discard changes in the working directory or unstage files (modern replacement for part of git checkout).",
                "url": "https://delaparra-services.nl/knowledge-hub/git-restore",
                "identifier": "https://delaparra-services.nl/knowledge-hub/git-restore#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/git-restore#term"
                },
                "creator": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://creativecommons.org/licenses/by/4.0/",
                "creditText": "Coders Lingo (https://coderslingo.com/resources/open-dataset/), CC BY 4.0",
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "keywords": "Git commands",
                "version": "2026-11-25",
                "dateModified": "2026-11-25T17:46:27+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/knowledge-hub#dataset",
                    "name": "IT terms from A to Z",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "git-restore.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/git-restore.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:27+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "git-restore.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/git-restore.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:27+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "git-restore.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/git-restore.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:27+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "git-restore.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/git-restore.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:27+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "git-restore.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/git-restore.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:27+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "git-restore-skills.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/git-restore/skills.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:27+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    }
                ]
            }
        ]
    }
}