I am currently on (no branch) with uncommitted changes. I would like to check out a different branch and throw away all my changes.
When I do
git checkout <branch_name>
I get:
**error: Your local changes to the following files would be overwritten by checkout:
avar/libs/video_preprocessing_controller/video_preprocessing_controller.cpp
bbn/tracker/libs/init_and_cont_tracks/init_and_cont_tracks.cpp
Please, commit your changes or stash them before you can switch branches.
Aborting**
I don’t want to commit nor stash my changes. Do I not have a third option? (ignore them/throw them away)
Use
git checkout -f [branch name]Alternatively, to throw away your local changes first, you can go with