You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I have only used Sourcetree for a single branch. Now I have been working on a dev branch on a laptop while I was away. When I got back to my desktop, I didn't know that I had to checkout the dev branch (again, sorry for being such a newb) and I did a pull thinking it would know to create the dev branch, and it all went into the master. So now my master branch and dev branch look exactly the same. I now have checked out the dev branch to the desktop, but the master and the dev branch still look the same in terms pf commits. So do I now just 'remove' the commits to master?
It sounds like you are wanting to do a hard reset - effectively 'delete' the merge with master that happened.
If that is so, there are two ways I can think of.
You can tell git/Sourcetree to reverse the merge commit - to undo the changes introduced from the merge, but creating a new commit - still showing that a merge with master happened.
Or you can hard reset your working branch to a previous commit if you want it to look like the merge never happened. Make sure you pick the correct commit you want to reset to.
*Note if you have already pushed this unwanted commit to a remote, you will have to force push after your hard reset to overwrite the branch on the remote. Otherwise git/Sourcetree will not allow you to push your changes because it will say that your branch doesn't match the remote and needs to be merged with it - and if you did that, it would re-introduce the commit you don't want.
Reverting the commit would be the more mainstream/recommended way of using git, rather than a hard reset. But I find myself doing a hard reset and force push from time to time.