[TOC]
# [git 教程]([https://www.yuque.com/docs/share/0f91ee08-abee-4846-a6c5-42be69b816d4#rylidu](https://www.yuque.com/docs/share/0f91ee08-abee-4846-a6c5-42be69b816d4#rylidu))
# git stash和git stash pop
git stash 可用來暫存當前正在進行的工作, 比如想pull 最新代碼, 又不想加新commit, 或者另外一種情況,為了fix 一個緊急的bug,? 先stash, 使返回到自己上一個commit, 改完bug之后再stash pop, 繼續原來的工作。
基礎命令:
**$git stash
$do some work
$git stash pop**
進階:
git?stashsave?"work in progress for foo feature"
**當你多次使用’git stash’命令后**,你的棧里將充滿了未提交的代碼,這時候你會對將哪個版本應用回來有些困惑,
’**git stash list**’ 命令可以將當前的Git棧信息打印出來,你只需要將找到對應的版本號,例如使用’**git stash apply stash@{1}’就可以將你指定版本號為stash@{1}的工作取出來**,當你將所有的棧都應用回來的時候,可以使用’**git stash clear**’來將棧清空。
~~~
git stash # save uncommitted changes
# pull, edit, etc.
git stash list # list stashed changes in this git
git show stash@{0} # see the last stash
git stash pop # apply last stash and remove it from the list
git stash --help # for more info
~~~
# 版本回退
**git推送到遠程錯誤的文件怎么處理**
> 1. 先回退到前一個版本:
>
>
> git reset --hard HEAD^
>
> 2. 然后強制推送當前這個版本到云端
>
>
> git push origin HEAD --force
# git撤回到任意位置
1、運行`git reflog`命令查看你的歷史變更記錄

2.然后用`git reset --hard HEAD@{n}`,(n是你要回退到的引用位置)回退。
比如上圖可運行`git reset --hard 40a9a83`
- Introduction
- 1.配置sublime
- 1.1sublime配置sass
- 1.2sublime配置less
- 2.webstrom配置sass
- 3.vscode前端開發環境配置
- 4.git補充教程
- sass安裝環境的配置:
- 部署網站(域名解析到服務器)
- 字體壓縮
- jshint(js錯誤提示)
- 格式轉換器
- sourceTree
- 配置接口
- Java環境變量
- 激活
- 大白菜裝機
- 真機調試
- 彩色字
- docsify配置和使用
- vscode插件安裝
- git分支管理
- 更換遠程倉庫地址
- fork項目
- 獲取全部分支
- git 開發管理
- git 代碼提示
- git 常用操作
- 預提交問題
- vpn
- 禪道
- 藍湖
- px to rem 插件
- 插件同步
- 項目代碼格式校驗
- 在全局配置的文件可以直接使用process.env訪問到
- 快捷鍵設置
- 安裝node-sass
- 使用yarn commit 提交代碼
- vscode 開啟大小寫敏感
- vscode插件換位置
- 清除vscode
- vscode 配置
- 全局安裝的插件無法使用,說的是什么禁止運行腳本??
- mac配置ssh
- git 配置郵箱/用戶名
- 終端查找文件
- vscode外觀設置
- 大數據學習路線
- mac
- 裝nvm,node包管理工具