1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 17:42:07 +02:00
tldr/pages/common/git-restore.md
2019-08-23 19:22:38 +02:00

17 lines
473 B
Markdown

# git restore
> Restore working tree files. Requires git version 2.23+.
> See also `git checkout`.
> More information: <https://git-scm.com/docs/git-restore/>.
- Restore a deleted file from the contents of the current commit (HEAD):
`git restore {{path/to/file}}`
- Restore a file to a version from a different commit:
`git restore --source {{commit}} {{path/to/file}}`
- Undo any uncommitted changes to tracked files, reverting to the current HEAD:
`git restore .`