19

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

Thanks in advance.

mstrap
  • 16,808
  • 10
  • 56
  • 86
Mahesh Gulve
  • 255
  • 1
  • 3
  • 16
  • 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. – Sambuxc Jun 01 '23 at 15:55

3 Answers3

40

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.

mstrap
  • 16,808
  • 10
  • 56
  • 86
  • 1
    *Beware!!!* This reverts all files to versions before that commit instead of just removing the commit from Log! – GrayFace Jul 04 '20 at 15:22
3

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

Vampire
  • 35,631
  • 4
  • 76
  • 102
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 :)

Community
  • 1
  • 1
Didi
  • 248
  • 2
  • 18