Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SourceTree - Not sure how to go back to a previous commit

So I'm fairly new to version control but managed to setup sourceTree with bitbucket relatively easily.

I also now understanding basic concepts such as commit, push and pull.

I can't however find any documentation (that doesn't involve text commands) on how to revert all my uncommitted changes at once to the last commit (not pushed). I can do it individually for each file but this is taking far too long.

Many thanks!

like image 298
apple741 Avatar asked Nov 14 '13 19:11

apple741


1 Answers

Well I have never tried SourceTree, but you are looking for command

git reset --hard HEAD

which means reset working tree and index to the state of your latest commit. Looking at some SourceTree screenshorts there are two buttons with same icons that might help you. I guess they have different names in different SourceTree versions. You might want to check what's behind Reset or Discard button. Look to hard reset to the HEAD commit.

like image 110
Kalle Pokki Avatar answered Oct 02 '22 21:10

Kalle Pokki