How to undo commit operation in SmartGit/Git
Asked Answered
O

3

20

Want to undo commit operation in smart git. Accidently commited wrong code and now unable to recover that code.

Thanks in advance.

Overmantel answered 5/7, 2016 at 11:57 Comment(1)
Just use the reset option. So if you want to go 1 commit back in time, right-click on the commit to want to go to and click "Reset". That will COMPLETELY REMOVE any commits in front of it.Compander
S
41

In SmartGit, just invoke Local|Undo Last Commit; this will put your changes back to the Index. Now you may revert them partially or all together using Local|Discard.

Spice answered 5/7, 2016 at 16:27 Comment(1)
Beware!!! This reverts all files to versions before that commit instead of just removing the commit from Log!Almire
W
3

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

Withers answered 5/7, 2016 at 12:0 Comment(0)
M
1

please watch this topic : smartgit delete commit and return to previous commit

as the answer said, it's not specific to smartgit but git in general. You just have to rollback to the previous commit, create another branch and work on it !

Be careful with your following commits :)

Mortify answered 5/7, 2016 at 12:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.