Quantcast
Viewing latest article 30
Browse Latest Browse All 80

Answer by Rob for How do I delete a commit from a branch?

I'm appending this answer because I don't see why anyone who has just tried to commit work would want to delete all that work because of some mistake using Git!

If you want to keep your work and just 'undo' that commit command (you caught before pushing to repo):

git reset --soft HEAD~1

Do not use the --hard flag unless you want to destroy your work in progress since the last commit.


Viewing latest article 30
Browse Latest Browse All 80

Trending Articles