git: checkout files from another branch into current branch (don’t switch HEAD to the other branch)

checkout by providing the current path, .:

git checkout other-branch-name -- .

This operation is similar to switching HEAD to another branch without checking out files, but just from the “other direction”.

As @김민준 mentions, this overwrites any uncommitted changes. Remember to either stash or commit them somewhere first if needed.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)