当前位置:网站首页>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 
边栏推荐
- 《网络是怎么样连接的》读书笔记 - FTTH
- Launpad | basic knowledge
- 什么是uid?什么是Auth?什么是验证器?
- How do microservices aggregate API documents? This wave of show~
- 1211 or chicken and rabbit in the same cage
- Codeforces Round #793 (Div. 2)(A-D)
- Analysis report on the production and marketing demand and investment forecast of tellurium dioxide in the world and China Ⓣ 2022 ~ 2027
- 《网络是怎么样连接的》读书笔记 - WEB服务端请求和响应(四)
- 【无标题】转发最小二乘法
- Turn: excellent managers focus not on mistakes, but on advantages
猜你喜欢

Solve the problem of "Chinese garbled MySQL fields"

【无标题】转发最小二乘法

Getting started with microservices: gateway gateway

Educational Codeforces Round 115 (Rated for Div. 2)

【LeetCode 42】501. Mode in binary search tree

After unplugging the network cable, does the original TCP connection still exist?

HMS core helps baby bus show high-quality children's digital content to global developers

ArcGIS application (XXII) ArcMap loading lidar Las format data
![C language - Introduction - Foundation - syntax - [identifier, keyword, semicolon, space, comment, input and output] (III)](/img/89/0f5f4ba07c637b09abe873016cba2d.png)
C language - Introduction - Foundation - syntax - [identifier, keyword, semicolon, space, comment, input and output] (III)
![[untitled] forwarding least square method](/img/8b/4039715e42cb4dc3e1006e8094184a.png)
[untitled] forwarding least square method
随机推荐
Awk from entry to earth (14) awk output redirection
Industry depression has the advantages of industry depression
awk从入门到入土(7)条件语句
Report on research and investment prospects of polyglycolic acid industry in China (2022 Edition)
"How to connect the network" reading notes - Web server request and response (4)
Implementation principle of redis string and sorted set
C语言-入门-基础-语法-数据类型(四)
Dynamic analysis and development prospect prediction report of high purity manganese dioxide in the world and China Ⓡ 2022 ~ 2027
Awk from getting started to digging in (4) user defined variables
微服務入門:Gateway網關
Research Report on research and investment prospects of China's testing machine industry (2022 Edition)
Reading notes of how the network is connected - understanding the basic concepts of the network (I)
swatch
Global and Chinese markets of thrombography hemostasis analyzer (TEG) 2022-2028: Research Report on technology, participants, trends, market size and share
Tkinter Huarong Road 4x4 tutorial II
Global and Chinese trisodium bicarbonate operation mode and future development forecast report Ⓢ 2022 ~ 2027
UML sequence diagram [easy to understand]
C语言-入门-基础-语法-[主函数,头文件](二)
awk从入门到入土(6)正则匹配
awk从入土到入门(10)awk内置函数