Prepare repository for merge

This commit is contained in:
Angelos Chalaris
2023-05-01 22:28:09 +03:00
parent 7482512abf
commit a0255199d7
93 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,28 @@
---
title: Remove files from the staging area
type: snippet
tags: [commit]
author: chalarangelo
cover: coconuts
dateModified: 2021-04-13T21:10:59+03:00
---
Removes files from the staging area.
- Use `git restore --staged <pathspec>` to remove files from the staging area.
- `<pathspec>` can be a filename or a fileglob.
```shell
git restore --staged <pathspec>
```
```shell
git restore --staged "30seconds.txt"
# Remove the file `30seconds.txt` from the staging area
git restore --staged src/*.json
# Remove all files with a `.json` extension in the `src` directory
git restore --staged .
# Remove all changes from the staging area
```