recently we moved from TFS to GIT so I am still learning how to use this amazing tool.

At the moment I am working in a very simple structure like the following one:

```
main -------------------------------------- 01 ----------
\                                           /
 dev ----------------------- 01 ---------- 02 ----------
  \                          /             /
   feat/login ------ 01 --- 02 --- 03 --- 04 --- 05 ---

```

* Developers work on `feature/something` and every tot hours they check-in and trigger a build with tests
* When the feature is stable they merge back into `dev` which will contains 1 or more checkins from `feature/something`
* When the whole feature is ready, they merge the feature from `dev` into `main`

The questions are the following:

* If I start to work from `feat/login`, if I do `git checkout dev` I don't get the latest code from `dev` but also my latest local file changed in `feat/login`. **How can I checkout `dev` without carry over the local changes not commited from my previous branch?**
* Assuming a developer made a mistake, how can I `rollback` to a previous check-in `01` in `dev` and push it so that the latest check-in `02` is not the last one anymore?