git checkout branch preserve changes? code example Example: git checkout commit git checkout <commit>