Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

38
git-restore Normal file
View File

@@ -0,0 +1,38 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# git restore
> Restore working tree files. Requires Git version 2.23+.
> See also `git checkout` and `git reset`.
> More information: <https://git-scm.com/docs/git-restore>.
- Restore an unstaged file to the version of the current commit (HEAD):
`git restore {{path/to/file}}`
- Restore an unstaged file to the version of a specific commit:
`git restore --source {{commit}} {{path/to/file}}`
- Discard all unstaged changes to tracked files:
`git restore :/`
- Unstage a file:
`git restore --staged {{path/to/file}}`
- Unstage all files:
`git restore --staged :/`
- Discard all changes to files, both staged and unstaged:
`git restore --worktree --staged :/`
- Interactively select sections of files to restore:
`git restore --patch`