diff options
Diffstat (limited to 'doc/university/training/topics/unstage.md')
-rw-r--r-- | doc/university/training/topics/unstage.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/university/training/topics/unstage.md b/doc/university/training/topics/unstage.md index 9a9d42221a4..b74cc9b2f0a 100644 --- a/doc/university/training/topics/unstage.md +++ b/doc/university/training/topics/unstage.md @@ -6,25 +6,25 @@ comments: false - To remove files from stage use reset HEAD where HEAD is the last commit of the current branch. This will unstage the file but maintain the modifications. - ```bash + ```shell git reset HEAD <file> ``` - To revert the file back to the state it was in before the changes we can use: - ```bash + ```shell git checkout -- <file> ``` - To remove a file from disk and repo use `git rm` and to remove a directory use the `-r` flag: - ```sh + ```shell git rm '*.txt' git rm -r <dirname> ``` - If we want to remove a file from the repository but keep it on disk, say we forgot to add it to our `.gitignore` file then use `--cache`: - ```sh + ```shell git rm <filename> --cache ``` |