Want to undo commit operation in smart git. Accidently commited wrong code and now unable to recover that code.
Thanks in advance.
The easiest way to undo the last Git commit is to execute the “git reset” command with the “–soft” option that will preserve changes done to your files. You have to specify the commit to undo which is “HEAD~1” in this case. The last commit will be removed from your Git history.
To undo the last commit from a remote git repository, you can use the git reset command. command. This will undo the last commit locally. command to force push the local commit which was reverted to the remote git repository.
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.
The actual commit
command can be undone by git reset --soft @~
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With