From 35cfffebd5db40837e285a8731eadc1a2d99f7c1 Mon Sep 17 00:00:00 2001 From: Aditya Sridhar Date: Thu, 18 Apr 2019 10:26:18 +0530 Subject: [PATCH] Added points to note while using git reset (#25267) * Added points to note while using git reset Using --hard option can be dangerous. Added a warning to mention the same. * Added points to note while using git reset - pull request fixes Co-Authored-By: aditya-sridhar --- guide/english/git/git-reset/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/guide/english/git/git-reset/index.md b/guide/english/git/git-reset/index.md index ac7e1c2b2a..5d67eeb295 100644 --- a/guide/english/git/git-reset/index.md +++ b/guide/english/git/git-reset/index.md @@ -36,5 +36,9 @@ The options for `MODE` are: - `--merge`: resets the index and updates the files in the working tree that are different between `commit` and HEAD, but keeps those which are different between the index and working tree - `--keep`: resets index entries and updates files in the working tree that are different between `commit` and HEAD. If a file that is different between `commit` and HEAD has local changes, the reset is aborted +### Points to Note + +Be very careful when using the `--hard` option with `git reset` since it resets your commit, staging area and your working directory. If this option is not used properly then one can end up losing the code that is written. + ### More Information: - [Git reset documentation](https://git-scm.com/docs/git-reset)