---
title: "Discussion on \"GIT : RESET --hard\" | Hashnode"
description: "Discussion on \"GIT : RESET --hard\". If you messed up your code and you want to revert the changes you made, you can use  \ngit reset --hard [commit]\n where  [commit]  is the \"commit hash\" you want to go back to.\n\n\nThe files of the working directory and the staging area will be reset to ..."
url: "https://hashnode.com/posts/git-reset-hard/5f6884356dfc523d0a8946e6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [GIT : RESET --hard](https://papidev.hashnode.dev/git-reset-hard?utm_source=hashnode&utm_medium=feed)

If you messed up your code and you want to revert the changes you made, you can use git reset --hard \[commit\] where \[commit\] is the "commit hash" you want to go back to. The files of the working directory and the staging area will be reset to ...

Sep 21, 2020 · 1 min read · papidev.hashnode.dev  
Read the article

-   [#git](https://hashnode.com/tag/git)

## Written by

[Luca Zanzottera](https://hashnode.com/@Zanz)

@Zanz · Italy

  
[View profile](https://hashnode.com/@Zanz)

## Responses 2

Markdown supported · ⌘↵ to post

[Ghost](https://hashnode.com/@incognito-)

[Oct 14, 2022](https://hashnode.com/posts/git-reset-hard/5f6884356dfc523d0a8946e6/comment/6349d030aea8ad4e982c5a98)

Sometimes I need to use this at work[,](https://www.youtube.com/watch?v=Ak_FBkBQ1Ng) I've made a fair share of accidental commits.

[Dinys Monvoisin](https://hashnode.com/@dinmon)

[Sep 21, 2020](https://hashnode.com/posts/git-reset-hard/5f6884356dfc523d0a8946e6/comment/5f68952c35d6463d2b5f9767)

I prefer to use some Git GUI client for those change, I do not want to mess with things any further.
