Merge branch 'toptal-more-specific-removal-of-a-file-from-commit'
This commit is contained in:
commit
a38b385b03
|
@ -133,11 +133,11 @@ In order to remove a file from a commit, do the following:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ git checkout HEAD^ myfile
|
$ git checkout HEAD^ myfile
|
||||||
$ git add -A
|
$ git add myfile
|
||||||
$ git commit --amend
|
$ git commit --amend --no-edit
|
||||||
```
|
```
|
||||||
|
|
||||||
This is particularly useful when you have an open patch and you have committed an unnecessary file, and need to force push to update the patch on a remote.
|
This is particularly useful when you have an open patch and you have committed an unnecessary file, and need to force push to update the patch on a remote. The `--no-edit` option is used to keep the existing commit message.
|
||||||
|
|
||||||
<a name="delete-pushed-commit"></a>
|
<a name="delete-pushed-commit"></a>
|
||||||
### I want to delete or remove my last commit
|
### I want to delete or remove my last commit
|
||||||
|
|
Loading…
Reference in New Issue