Skip to content
Discussion options

You must be logged in to vote

To undo your last local commit (that hasn't been pushed to GitHub yet), you can use the git reset command. There are two main ways to do this depending on what you want to do with your changes:

1. Undo the commit but KEEP your changes (Recommended)

If you want to keep the work you did in the files so you can edit and commit them again, run:

git reset --soft HEAD~1

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by muhammedadnank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants