mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 14:22:07 +02:00
git-restore: add page (#3247)
This commit is contained in:
parent
69b65ed360
commit
22dc13a408
1 changed files with 17 additions and 0 deletions
17
pages/common/git-restore.md
Normal file
17
pages/common/git-restore.md
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# 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 .`
|
Loading…
Add table
Reference in a new issue