Sublime Forum

Reset all local changes

#1

Is there a way to delete all local changes and reset back to whatever the most current version is?

I’ve done some research, and either there’s nothing on this or I’m just using the wrong words to search. Basically, I just want to get rid of any local changes (I don’t care about them) and re-clone the repository/branch. Do I need to stash first (then I can delete the stash)?

0 Likes

#2

git reset --hard HEAD && git clean --force (removed all staged/unstaged files)
git reset --hard <commit_hash> && git clean --force (roll back to previous commit)
git reset --hard origin/HEAD (roll back to last remote push)

0 Likes

#3

“Discard All” resets all modified files and “Delete All” deletes all untracked files. Doing a hard-reset by right-clicking on a commit/branch will also remove all modifications.

2 Likes

#4

Can you explain where I can find this in sublime merge? I’m sure I’m just being blind, but I can’t seem to find anything along these lines…

0 Likes

#5

0 Likes

#6

I’m totally new to this. Could you or anyone tell me about the Soft Reset?

0 Likes

#7

Soft Reset will “undo” the commits up until the selected commit.
Any “undone” changes will appear in the staged files section of the interface.

For example:
You make a commit my commit with changes to the file my file.
If you then soft reset to the commit before my commit, the changes to my file will no longer be committed, and instead re-appear in the “Staged Files” section.

1 Like