15

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

Thanks in advance.

mstrap
  • 15,846
  • 8
  • 52
  • 81
Mahesh Gulve
  • 215
  • 1
  • 3
  • 14

3 Answers3

37

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
  • 15,846
  • 8
  • 52
  • 81
  • *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
2

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

Vampire
  • 32,892
  • 3
  • 65
  • 94
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