Git reset options
Reset allows you to go back to a previous working state. This is useful in scenarios where you need to undo changes and start over. For example, if you want to start a feature or task from scratch and discard all your uncommitted work.
There are two reset options:
- Reset to latest local commit: This will discard all your uncommitted changes in your local branch. Any local commits that have not been pushed to remote will not be affected.
- Reset to latest remote commit: This will discard all your uncommitted changes and local commits that have not been pushed to remote. It will also pull the latest commits from remote.
How to reset your branch
Follow the steps below to perform a reset:
- Click the branch menu on the project bar.
- Click Reset branch in the drop-down menu. The Reset branch dialog will open.
-
Select your preferred reset option:
- If you select Reset to latest local commit, the number of uncommitted changes that will be discarded will be displayed. Click the box next to "I understand that I will lose any changes in this branch."
- If you select Reset to latest remote commit, the number of uncommitted changes and local commits that will be discarded will be displayed, as well as the number of commits that you will pull from remote. Click the box next to "I understand that I will lose any changes in this branch and will pull from remote."
-
Click Reset to perform the reset. Otherwise, click Cancel to cancel the reset.