当前位置:网站首页>How does idea withdraw code from remote push
How does idea withdraw code from remote push
2022-07-04 09:14:00 【The fruit of it midsummer】
In normal development , We often commit some wrong code to the remote branch by hand , At this time, we want to withdraw quickly to avoid unnecessary problems caused by the error code being pulled by colleagues , Today we will demonstrate :
First of all, this is the code in my remote warehouse :
My local code :
operation : Hand error twice in a row ( First submission and second submission ) Submit the local error code to the remote warehouse
git Submit the record :(nio It's actually my first time to submit information. I mistakenly wrote it here , But it doesn't affect )
Local code records :
Remote warehouse records :
At this time, mistakes have been made , I have submitted the wrong code to the remote branch twice by hand , So how can I withdraw ?
At this time, find the submission you want to withdraw to , Right click to select (Reset Current Branch to Here). such as : I want the code to roll back to what it looked like when I first submitted , Just find my first submission nio Right click to select Reset Current Branch to Here Click to select the second one Mixed Click ok
At this time, you will find that your local code is still the same as before , But it shows no commit The state of .
Find your local change record at this time ( Is our usual code commit The box that pops out when )
Click on this. " Arrow returned " Roll back
Click on Rollback after , Our code will return to the way we first submitted .
But at this time, it is only local restore , The previously submitted error code is still on the remote . So we need to cover the code to the remote .
Because the previous operations are first update>>>>>push, But in our case , Will pull down the remote error code , Then our previous operations are in vain , So it needs to be enforced push. Although we didn't submit information at this time , But we can still choose to force push.
Be careful : At this time, I found idea mandatory push Button gray , So I changed it to command line coercion push.
git push origin HEAD --force
Finally, it is found that the remote code has been successfully overwritten
边栏推荐
- Research Report on the development trend and Prospect of global and Chinese zinc antimonide market Ⓚ 2022 ~ 2027
- C语言-入门-基础-语法-[运算符,类型转换](六)
- 165 webmaster online toolbox website source code / hare online tool system v2.2.7 Chinese version
- Opencv environment construction (I)
- Some points needing attention in PMP learning
- HMS core helps baby bus show high-quality children's digital content to global developers
- Dede plug-in (multi-function integration)
- Launchpad x | mode
- Awk from entry to earth (18) GAW K line manual
- Global and Chinese market of bipolar generators 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
Getting started with microservices: gateway gateway
Ehrlich sieve + Euler sieve + interval sieve
Live in a dream, only do things you don't say
LeetCode 74. Search 2D matrix
C语言-入门-基础-语法-[标识符,关键字,分号,空格,注释,输入和输出](三)
2022-2028 global intelligent interactive tablet industry research and trend analysis report
HMS core helps baby bus show high-quality children's digital content to global developers
Dede plug-in (multi-function integration)
Some points needing attention in PMP learning
Clion console output Chinese garbled code
随机推荐
The map set type is stored in the form of key value pairs, and the iterative traversal is faster than the list set
Awk from entry to earth (12) awk can also write scripts to replace the shell
Review of last week's hot spots (6.27-7.3)
Launchpad x | mode
C language - Introduction - Foundation - syntax - [variable, constant light, scope] (V)
Launpad | 基础知识
In depth research and investment strategy report on China's hydraulic parts industry (2022 Edition)
C language - Introduction - Foundation - syntax - [operators, type conversion] (6)
How do microservices aggregate API documents? This wave of show~
awk从入门到入土(7)条件语句
awk从入门到入土(12)awk也可以写脚本,替代shell
Report on the development trend and prospect trend of high purity zinc antimonide market in the world and China Ⓕ 2022 ~ 2027
Jianzhi offer 09 realizes queue with two stacks
ArrayBuffer
Leetcode topic [array] - 121 - the best time to buy and sell stocks
Global and Chinese markets of hemoglobin analyzers in care points 2022-2028: Research Report on technology, participants, trends, market size and share
awk从入门到入土(9)循环语句
《网络是怎么样连接的》读书笔记 - WEB服务端请求和响应(四)
C语言-入门-基础-语法-[运算符,类型转换](六)
Horizon sunrise X3 PI (I) first boot details