From 7c01250bbfaef5b0fa8abc2c842ca281acb4b51c Mon Sep 17 00:00:00 2001 From: Hannah Kim Date: Sun, 22 Oct 2023 09:54:03 -0700 Subject: [PATCH] Add markdown syntax for indicating a phrase as code --- git/intermediate_git/a_deeper_look_at_git.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/intermediate_git/a_deeper_look_at_git.md b/git/intermediate_git/a_deeper_look_at_git.md index 58a36866ba8..6a0bf5e1071 100644 --- a/git/intermediate_git/a_deeper_look_at_git.md +++ b/git/intermediate_git/a_deeper_look_at_git.md @@ -120,7 +120,7 @@ Let's start by looking a bit closer at what happened here. When you ran `git res Now let's say we want to move where HEAD points to but *don't* want to touch the staging area. If we want to leave the index alone, you can use `git reset --soft`. This would only perform the first part of `git reset` where the HEAD is moved to point somewhere else. -You can think of git reset --soft as a more powerful amend. Instead of changing the last commit, you can go back multiple commits and combine all the changes included in them into one commit. +You can think of `git reset --soft` as a more powerful amend. Instead of changing the last commit, you can go back multiple commits and combine all the changes included in them into one commit. The last part of reset we want to touch upon is `git reset --hard`. What this does is it performs all the steps of `git reset`, moving the HEAD and updating the index, but it *also* updates the working directory. This is important to note because it can be dangerous as it can potentially destroy data. A hard reset overwrites the files in the working directory to make it look exactly like the staging area of wherever HEAD ends up pointing to. Similarly to `git commit --amend`, a hard reset is a destructive command which overwrites history. This doesn't mean you should completely avoid it if working with shared repositories on a team with other developers. You should, however, **make sure you know exactly why you're using it, and that your coworkers are also aware of how and why you're using it.**