How to undo commit operation in SmartGit / Git

Want to cancel the commit operation in smart git. I accidentally committed the wrong code and now cannot restore this code.

Thanks in advance.

+6
source share
3 answers

In SmartGit, just call Local | Undo the last commit ; this will return your changes to the Index. Now you can partially or completely remove them using Local Reset .

+14
source

The actual commit command can be undone with git reset --soft @~

+1
source

Please browse this thread: smartgit remove commit and revert to previous commit

as the answer said, it is not specific to smartgit, but git in general. You just need to roll back to the previous commit, create another branch and work on it!

Follow these rules :)

+1
source

All Articles