Skip to content

Commit

Permalink
Add markdown syntax for indicating a phrase as code
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahkim313 committed Oct 22, 2023
1 parent a246619 commit 7c01250
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git/intermediate_git/a_deeper_look_at_git.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.**
Expand Down

0 comments on commit 7c01250

Please sign in to comment.