Skip to content

Instantly share code, notes, and snippets.

@wilsonsilva
Created June 21, 2017 15:47
Show Gist options
  • Star 28 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save wilsonsilva/c6f870e6423a1c0076224d1f1e468dbb to your computer and use it in GitHub Desktop.
Save wilsonsilva/c6f870e6423a1c0076224d1f1e468dbb to your computer and use it in GitHub Desktop.
Undo last commit but keep changes
# https://stackoverflow.com/a/44672195/3013522
git reset --soft HEAD~1
@MeghaNagari
Copy link

Thanks this worked perfectly fine.

@blestab
Copy link

blestab commented Aug 27, 2018

Just what i needed. Awesome!

@vfediuchko
Copy link

Thanks

@Olivier50
Copy link

Thanks, perfect!

@felipe-pita
Copy link

Thanks!!!

@oddnavy
Copy link

oddnavy commented Jan 23, 2019

💥

@pologonzalo
Copy link

awesome!

@londoncalling
Copy link

Thank you! A lightbulb just went on in my head.

@Nimash68
Copy link

👍

@Merwanski
Copy link

Thanks

@vanessaaleung
Copy link

thanks!

@PlinChen
Copy link

PlinChen commented Dec 1, 2022

thanks :)

@Arman-Ghazaryan
Copy link

How can I delete a specific commit and also keep changes?

@vladiuskor
Copy link

Thank you

@arunbear
Copy link

@Arman-Ghazaryan something like

git revert --no-commit abc123

See git revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment