From 1dfde8b272fbf3da7e2cc2aec32973ccbd8885d0 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 18 Aug 2019 14:23:20 +0100 Subject: [PATCH 1/4] git-restore: add page --- pages/common/git-restore.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 pages/common/git-restore.md diff --git a/pages/common/git-restore.md b/pages/common/git-restore.md new file mode 100644 index 00000000000000..b863ebff3cf798 --- /dev/null +++ b/pages/common/git-restore.md @@ -0,0 +1,17 @@ +# git restore + +> Restore working tree files. Requires git version 2.23+. +> See also `git checkout`. +> More information: . + +- Restore a file that was accidentally deleted: + +`git restore {{path/to/file}}` + +- Restore a file to an earlier version: + +`git restore --source {{commit}} {{path/to/file}}` + +- Restore all the files in the current working tree to the last committed version: + +`git restore .` From 8a0f25b25a8d8f41571d9f994dd7082b5c8c19d7 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 18 Aug 2019 14:24:26 +0100 Subject: [PATCH 2/4] git-restore: ninja-edit to fix url --- pages/common/git-restore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/git-restore.md b/pages/common/git-restore.md index b863ebff3cf798..008a9418db2334 100644 --- a/pages/common/git-restore.md +++ b/pages/common/git-restore.md @@ -2,7 +2,7 @@ > Restore working tree files. Requires git version 2.23+. > See also `git checkout`. -> More information: . +> More information: . - Restore a file that was accidentally deleted: From 3fc9c36a3309de6fe29988fc49f51554af38d0ef Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 20 Aug 2019 21:52:35 +0100 Subject: [PATCH 3/4] Update git-restore.md --- pages/common/git-restore.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/common/git-restore.md b/pages/common/git-restore.md index 008a9418db2334..7dfbffa49bbece 100644 --- a/pages/common/git-restore.md +++ b/pages/common/git-restore.md @@ -4,14 +4,14 @@ > See also `git checkout`. > More information: . -- Restore a file that was accidentally deleted: +- Restore a file from the current HEAD that was previously deleted: `git restore {{path/to/file}}` -- Restore a file to an earlier version: +- Restore a file to a version from a different commit: `git restore --source {{commit}} {{path/to/file}}` -- Restore all the files in the current working tree to the last committed version: +- Undo any uncommitted changes to tracked files, reverting to the current HEAD: `git restore .` From b3e60fb7dd9f723dcbcc1028b1cc81587ac476ca Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 23 Aug 2019 17:57:21 +0100 Subject: [PATCH 4/4] Update pages/common/git-restore.md Co-Authored-By: Waldir Pimenta --- pages/common/git-restore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/git-restore.md b/pages/common/git-restore.md index 7dfbffa49bbece..c8b5e9b8ed6c3d 100644 --- a/pages/common/git-restore.md +++ b/pages/common/git-restore.md @@ -4,7 +4,7 @@ > See also `git checkout`. > More information: . -- Restore a file from the current HEAD that was previously deleted: +- Restore a deleted file from the contents of the current commit (HEAD): `git restore {{path/to/file}}`