Not even sure HOW to ask this...
We have a repository (GIT)
I have local files... There was a problem, requiring me to desire to remove all of my local files and replace them with what is on the server.
When I tried to delete my files, SourceTree said.. OK, deleting files on the server, too... (!!NO!! Don't do that)
I have no idea how to approach this...
If you're not sure how to ask the question, then you probably haven't learned the fundamentals of git. I would recommend reading the free Git Book, especially the first three chapters.
To answer your question directly:
If you have not committed the bad changes, you can use the Discard button, and choose the Reset All tab to clear out all local changes.
If you have committed changes, and HAVE NOT PUSHED THEM, then what you want is a "hard reset". You do not remove files from your machine. Rather, you instruct your repository to replace your working copy with the files from an existing commit. In SourceTree, you can right-click the "good" commit in the graph, select "Reset to this commit", and choose the "hard" option.
If you have pushed bad changes to the remote repository, then the situation is more complex. Try searching "how to revert pushed changes in git".
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.