Reputation: 778
i am using Sourcetree git client with git lab. I am new to version control. Is there any way to discard my commit and go back. I haven't pushed that commit.
Upvotes: 5
Views: 5904
Reputation: 6716
I don't know about Sourcetree, but in "normal" git, i.e. command line git, you would simply do a soft reset:
git reset HEAD^
This will remove the commit but will leave the working directory, i.e. your actual files, as they are. You can then commit these changes in a new commit.
Upvotes: 7