Take ...
... and do it!
Git will not let you just lose the changes made over the commit, so you can safely make a new branch:
git checkout -b test
Fearing this would be worth switching to another branch that is on a different commit (say, with git checkout dev ); Git would pop you like this:
error: Your local changes to the following files would be overwritten by checkout: файл1 папка/файл2 Please, commit your changes or stash them before you can switch branches. Aborting
Backup plan
There is a stash in which you can place changes that you don’t want to commit, but you want to save them for a while. In this case, the use of stash is completely unnecessary, but it can be useful, for example, when the changes were applied to the wrong branch:
git stash -u # с сохранением untracked (неотслеживаемых) файлов git checkout dev # меняем ветку на другую, скажем, уже существующую git stash pop # забираем изменения обратно и выкидываем из стэша # ^- этот прямоугольник получился случайно, честно
Changes from the stash may well conflict with the state of the other branch, and if this happens, a conflict will arise and the set of changes will remain in the stash (because it was impossible to apply them purely).
Stash is one for the entire repository and is specific to a single local copy: relatively speaking, it is yours personally .