Saifullah khan
Saifullah khan

Reputation: 778

source tree how to discard an un pushed commit and go step back

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

Answers (2)

ayaz javed
ayaz javed

Reputation: 186

Just right click on your commit and reverse it.

Upvotes: 7

mattmilten
mattmilten

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

Related Questions