---
title: "Discussion on \"How to undo the last commit in Git?\" | Hashnode"
description: "Discussion on \"How to undo the last commit in Git?\". Originally Published Here 🚀!\nTo undo the last commit in Git, you can use the git reset command.\nYou have 2 ways to undo the last commit:\n\nThe first is the\n\ngit reset --soft HEAD~1\n\nthis command will undo the last commit. For most cases, this command..."
url: "https://hashnode.com/posts/undo-last-commit-in-git/60bbbb05fffc4c13b9cd6941"
---

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

Discussion

# [How to undo the last commit in Git?](https://melvingeorge-me.hashnode.dev/undo-last-commit-in-git?utm_source=hashnode&utm_medium=feed)

Originally Published Here 🚀! To undo the last commit in Git, you can use the git reset command. You have 2 ways to undo the last commit: The first is the git reset --soft HEAD~1 this command will undo the last commit. For most cases, this command...

Jun 5, 2021 · 1 min read · melvingeorge-me.hashnode.dev  
Read the article

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

## Written by

[MELVIN GEORGE](https://hashnode.com/@melvingeorge)

@melvingeorge · Bangalore

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

Hi, I'm Melvin George! 🖐️. A web developer and a blogger.

Hi, I'm Melvin George! 🖐️. A web developer and a blogger. I’ve written code for Mozilla, Qiskit, and an active contributor to many frontend open-source projects that are being used by millions of people around the world. 🚀 I love JavaScript, Rust, React.js, and many new exciting technologies that help society to find a solution to an existing problem 💖. Come check out my blog to see more of software development posts on these technologies. 🦄

## Responses 1

Markdown supported · ⌘↵ to post

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

[Oct 14, 2022](https://hashnode.com/posts/undo-last-commit-in-git/60bbbb05fffc4c13b9cd6941/comment/6349cf5caea8ad4e982c5a52)

Thanks for making this post! I've been doing a lot of resets lately at work[,](https://www.youtube.com/watch?v=Ak_FBkBQ1Ng) but I remember being clueless as to what to do when caught in this situation at random 😆
